Ignore:
Timestamp:
Mar 9, 2020, 11:09:52 AM (20 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
6565321
Parents:
87f572e (diff), e6cfa8ff (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.
Message:

Merge branch 'generator'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r87f572e r5b544a6  
    278278%token OTYPE FTYPE DTYPE TTYPE TRAIT                                    // CFA
    279279%token SIZEOF OFFSETOF
    280 // %token SUSPEND RESUME                                                                        // CFA
     280// %token RESUME                                                                        // CFA
     281%token SUSPEND                                                                  // CFA
    281282%token ATTRIBUTE EXTENSION                                                              // GCC
    282283%token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN
     
    12591260        | RETURN '{' initializer_list_opt comma_opt '}' ';'
    12601261                { SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; }
    1261         // | SUSPEND ';'
    1262         //      { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
    1263         // | SUSPEND compound_statement ';'
    1264         //      { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
     1262        | SUSPEND ';'
     1263                { $$ = new StatementNode( build_suspend( nullptr ) ); }
     1264        | SUSPEND compound_statement
     1265                { $$ = new StatementNode( build_suspend( $2 ) ); }
     1266        | SUSPEND COROUTINE ';'
     1267                { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Coroutine ) ); }
     1268        | SUSPEND COROUTINE compound_statement
     1269                { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Coroutine ) ); }
     1270        | SUSPEND GENERATOR ';'
     1271                { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Generator ) ); }
     1272        | SUSPEND GENERATOR compound_statement
     1273                { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Generator ) ); }
    12651274        | THROW assignment_expression_opt ';'                           // handles rethrow
    12661275                { $$ = new StatementNode( build_throw( $2 ) ); }
     
    20772086aggregate_control:                                                                              // CFA
    20782087        GENERATOR
    2079                 { SemanticError( yylloc, "generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
     2088                { yyy = true; $$ = AggregateDecl::Generator; }
    20802089        | MONITOR GENERATOR
    20812090                { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
Note: See TracChangeset for help on using the changeset viewer.