- Timestamp:
- Jan 25, 2022, 4:54:35 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 6b2d444, a488783, f681823
- Parents:
- f57f6ea0 (diff), 4fcbf26 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 6 edited
-
AST/Decl.cpp (modified) (2 diffs)
-
AST/Decl.hpp (modified) (2 diffs)
-
AST/Eval.hpp (modified) (1 diff)
-
AST/Print.cpp (modified) (1 diff)
-
Validate/InitializerLength.cpp (modified) (1 diff)
-
Validate/InitializerLength.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.cpp
rf57f6ea0 r97fed44 26 26 #include "Node.hpp" // for readonly 27 27 #include "Type.hpp" // for readonly 28 #include "Expr.hpp" 28 29 29 30 namespace ast { … … 65 66 for (auto & tp : this->type_params) { 66 67 ftype->forall.emplace_back(new TypeInstType(tp->name, tp)); 68 for (auto & ap: tp->assertions) { 69 ftype->assertions.emplace_back(new VariableExpr(loc, ap)); 70 } 67 71 } 68 72 this->type = ftype; -
src/AST/Decl.hpp
rf57f6ea0 r97fed44 34 34 // Must be included in *all* AST classes; should be #undef'd at the end of the file 35 35 #define MUTATE_FRIEND \ 36 template<typename node_t> friend node_t * mutate(const node_t * node); \36 template<typename node_t> friend node_t * mutate(const node_t * node); \ 37 37 template<typename node_t> friend node_t * shallowCopy(const node_t * node); 38 38 … … 135 135 std::vector< ptr<Expr> > withExprs; 136 136 137 138 137 FunctionDecl( const CodeLocation & loc, const std::string & name, std::vector<ptr<TypeDecl>>&& forall, 139 138 std::vector<ptr<DeclWithType>>&& params, std::vector<ptr<DeclWithType>>&& returns, -
src/AST/Eval.hpp
rf57f6ea0 r97fed44 24 24 template< typename... Args > 25 25 UntypedExpr * call( const CodeLocation & loc, const std::string & name, Args &&... args ) { 26 return new UntypedExpr { 27 loc, new NameExpr { loc, name }, 26 return new UntypedExpr { 27 loc, new NameExpr { loc, name }, 28 28 std::vector< ptr< Expr > > { std::forward< Args >( args )... } }; 29 29 } -
src/AST/Print.cpp
rf57f6ea0 r97fed44 333 333 print( node->funcSpec ); 334 334 335 if ( node->type ) { 335 336 337 if ( node->type && node->isTypeFixed ) { 336 338 node->type->accept( *this ); 337 339 } else { 338 os << "untyped entity"; 340 if (!node->type_params.empty()) { 341 os << "forall" << endl; 342 ++indent; 343 printAll(node->type_params); 344 os << indent; 345 --indent; 346 347 if (!node->assertions.empty()) { 348 os << "with assertions" << endl; 349 ++indent; 350 printAll(node->assertions); 351 os << indent; 352 --indent; 353 } 354 } 355 356 os << "function" << endl; 357 if ( ! node->params.empty() ) { 358 os << indent << "... with parameters" << endl; 359 ++indent; 360 printAll( node->params ); 361 if ( node->type->isVarArgs ) { 362 os << indent << "and a variable number of other arguments" << endl; 363 } 364 --indent; 365 } else if ( node->type->isVarArgs ) { 366 os << indent+1 << "accepting unspecified arguments" << endl; 367 } 368 369 os << indent << "... returning"; 370 if ( node->returns.empty() ) { 371 os << " nothing" << endl; 372 } else { 373 os << endl; 374 ++indent; 375 printAll( node->returns ); 376 --indent; 377 } 339 378 } 340 379 -
src/Validate/InitializerLength.cpp
rf57f6ea0 r97fed44 14 14 // 15 15 16 //#include "InitializerLength.hpp"16 #include "InitializerLength.hpp" 17 17 18 18 #include "AST/Expr.hpp" -
src/Validate/InitializerLength.hpp
rf57f6ea0 r97fed44 14 14 // 15 15 16 #pragma once 17 18 namespace ast { 19 class TranslationUnit; 20 } 21 16 22 namespace Validate { 17 23
Note:
See TracChangeset
for help on using the changeset viewer.