Changeset d3aa55e9 for src/Parser


Ignore:
Timestamp:
Jun 27, 2024, 4:42:01 PM (5 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
7552fde
Parents:
d5efcb7
Message:
  1. Disallow implicit conversion from cfa enum to int during on the function call site; 2. implement the reverse enum loop
Location:
src/Parser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cpp

    rd5efcb7 rd3aa55e9  
    216216                return new ast::ForStmt( location,
    217217                        std::move( astinit ),
    218                         range_over,
     218                        range_over, forctl->kind == OperKinds::LThan,
    219219                        buildMoveSingle( stmt ),
    220220                        buildMoveOptional( else_ )
  • src/Parser/StatementNode.hpp

    rd5efcb7 rd3aa55e9  
    6464        ForCtrl( StatementNode * stmt, ExpressionNode * condition, ExpressionNode * change ) :
    6565                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 ) {}
    6868
    6969        StatementNode * init;
     
    7171        ExpressionNode * change;
    7272        ExpressionNode * range_over;
     73        OperKinds kind;
    7374};
    7475
  • src/Parser/parser.yy

    rd5efcb7 rd3aa55e9  
    279279                DeclarationNode * indexDecl = DeclarationNode::newName( new std::string(identifier->name) );
    280280                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 );
    282282        } else {
    283283                SemanticError( yylloc, MISSING_LOOP_INDEX ); return nullptr;
Note: See TracChangeset for help on using the changeset viewer.