Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r9867cdb r0a6d8204  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar  6 17:26:45 2020
    13 // Update Count     : 4474
     12// Last Modified On : Mon Apr 27 12:25:42 2020
     13// Update Count     : 4483
    1414//
    1515
     
    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
     
    965966
    966967tuple_expression_list:
    967         assignment_expression_opt
    968         | tuple_expression_list ',' assignment_expression_opt
     968        assignment_expression
     969        | '@'                                                                                           // CFA
     970                { SemanticError( yylloc, "Eliding tuple element with '@' is currently unimplemented." ); $$ = nullptr; }
     971        | tuple_expression_list ',' assignment_expression
    969972                { $$ = (ExpressionNode *)($1->set_last( $3 )); }
     973        | tuple_expression_list ',' '@'
     974                { SemanticError( yylloc, "Eliding tuple element with '@' is currently unimplemented." ); $$ = nullptr; }
    970975        ;
    971976
     
    12651270        | RETURN '{' initializer_list_opt comma_opt '}' ';'
    12661271                { SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; }
    1267         // | SUSPEND ';'
    1268         //      { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
    1269         // | SUSPEND compound_statement ';'
    1270         //      { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
     1272        | SUSPEND ';'
     1273                { $$ = new StatementNode( build_suspend( nullptr ) ); }
     1274        | SUSPEND compound_statement
     1275                { $$ = new StatementNode( build_suspend( $2 ) ); }
     1276        | SUSPEND COROUTINE ';'
     1277                { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Coroutine ) ); }
     1278        | SUSPEND COROUTINE compound_statement
     1279                { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Coroutine ) ); }
     1280        | SUSPEND GENERATOR ';'
     1281                { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Generator ) ); }
     1282        | SUSPEND GENERATOR compound_statement
     1283                { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Generator ) ); }
    12711284        | THROW assignment_expression_opt ';'                           // handles rethrow
    12721285                { $$ = new StatementNode( build_throw( $2 ) ); }
     
    20832096aggregate_control:                                                                              // CFA
    20842097        GENERATOR
    2085                 { SemanticError( yylloc, "generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
     2098                { yyy = true; $$ = AggregateDecl::Generator; }
    20862099        | MONITOR GENERATOR
    20872100                { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
Note: See TracChangeset for help on using the changeset viewer.