Changeset 713926c


Ignore:
Timestamp:
Jun 29, 2018, 12:16:34 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
1f133dc
Parents:
9f66811
Message:

generalize waitfor routine, and error for no conditional on else after timeout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r9f66811 r713926c  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jun 24 10:41:10 2018
    13 // Update Count     : 3587
     12// Last Modified On : Fri Jun 29 10:31:42 2018
     13// Update Count     : 3596
    1414//
    1515
     
    11361136
    11371137waitfor:
    1138         WAITFOR '(' identifier ')'
    1139                 {
    1140                         $$ = new ExpressionNode( new NameExpr( *$3 ) );
    1141                         delete $3;
    1142                 }
    1143         | WAITFOR '(' identifier ',' argument_expression_list ')'
    1144                 {
    1145                         $$ = new ExpressionNode( new NameExpr( *$3 ) );
    1146                         $$->set_last( $5 );
    1147                         delete $3;
    1148                 }
     1138        WAITFOR '(' cast_expression ')'
     1139                { $$ = $3; }
     1140        | WAITFOR '(' cast_expression ',' argument_expression_list ')'
     1141                { $$ = (ExpressionNode *)$3->set_last( $5 ); }
    11491142        ;
    11501143
     
    11631156                { $$ = build_waitfor_timeout( nullptr, $3, $1 ); }
    11641157                // "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless)
     1158        | when_clause_opt timeout statement WOR ELSE statement
     1159                { SemanticError( yylloc, "else clause must be conditional after timeout or timeout never triggered." ); $$ = nullptr; }
    11651160        | when_clause_opt timeout statement WOR when_clause ELSE statement
    11661161                { $$ = build_waitfor_timeout( $2, $3, $1, $7, $5 ); }
Note: See TracChangeset for help on using the changeset viewer.