Changeset d3aa55e9 for src/Parser
- Timestamp:
- Jun 27, 2024, 4:42:01 PM (5 months ago)
- Branches:
- master
- Children:
- 7552fde
- Parents:
- d5efcb7
- Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cpp
rd5efcb7 rd3aa55e9 216 216 return new ast::ForStmt( location, 217 217 std::move( astinit ), 218 range_over, 218 range_over, forctl->kind == OperKinds::LThan, 219 219 buildMoveSingle( stmt ), 220 220 buildMoveOptional( else_ ) -
src/Parser/StatementNode.hpp
rd5efcb7 rd3aa55e9 64 64 ForCtrl( StatementNode * stmt, ExpressionNode * condition, ExpressionNode * change ) : 65 65 init( stmt ), condition( condition ), change( change ), range_over( nullptr ) {} 66 ForCtrl( StatementNode * decl, ExpressionNode * _range_over) :67 init( decl ), condition( nullptr ), change( nullptr ), range_over( _range_over) {}66 ForCtrl( StatementNode * decl, ExpressionNode * range_over, OperKinds kind ) : 67 init( decl ), condition( nullptr ), change( nullptr ), range_over( range_over ), kind( kind ) {} 68 68 69 69 StatementNode * init; … … 71 71 ExpressionNode * change; 72 72 ExpressionNode * range_over; 73 OperKinds kind; 73 74 }; 74 75 -
src/Parser/parser.yy
rd5efcb7 rd3aa55e9 279 279 DeclarationNode * indexDecl = DeclarationNode::newName( new std::string(identifier->name) ); 280 280 assert( range_over_expr ); 281 return new ForCtrl( new StatementNode( indexDecl ), range_over_expr );281 return new ForCtrl( new StatementNode( indexDecl ), range_over_expr, compop ); 282 282 } else { 283 283 SemanticError( yylloc, MISSING_LOOP_INDEX ); return nullptr;
Note: See TracChangeset
for help on using the changeset viewer.