Changeset 94b1022a for src/Parser/parser.yy
- Timestamp:
- May 30, 2018, 9:28:18 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- bd946e4
- Parents:
- 35718a9 (diff), ae32d96 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r35718a9 r94b1022a 175 175 bool flag; 176 176 CatchStmt::Kind catch_kind; 177 GenericExpr * genexpr; 177 178 } 178 179 … … 259 260 %type<flag> asm_volatile_opt 260 261 %type<en> handler_predicate_opt 262 %type<genexpr> generic_association generic_assoc_list 261 263 262 264 // statements … … 501 503 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 502 504 | GENERIC '(' assignment_expression ',' generic_assoc_list ')' // C11 503 { SemanticError( yylloc, "_Generic is currently unimplemented." ); $$ = nullptr; } 505 { 506 // add the missing control expression to the GenericExpr and return it 507 $5->control = maybeMoveBuild<Expression>( $3 ); 508 $$ = new ExpressionNode( $5 ); 509 } 504 510 ; 505 511 506 512 generic_assoc_list: // C11 507 |generic_association513 generic_association 508 514 | generic_assoc_list ',' generic_association 515 { 516 // steal the association node from the singleton and delete the wrapper 517 $1->associations.splice($1->associations.end(), $3->associations); 518 delete $3; 519 $$ = $1; 520 } 509 521 ; 510 522 511 523 generic_association: // C11 512 524 type_no_function ':' assignment_expression 525 { 526 // create a GenericExpr wrapper with one association pair 527 $$ = new GenericExpr( nullptr, { { maybeMoveBuildType($1), maybeMoveBuild<Expression>($3) } } ); 528 } 513 529 | DEFAULT ':' assignment_expression 530 { $$ = new GenericExpr( nullptr, { { maybeMoveBuild<Expression>($3) } } ); } 514 531 ; 515 532 … … 2081 2098 { $$ = $2; } 2082 2099 | '=' VOID 2083 { $$ = n ullptr; }2100 { $$ = new InitializerNode( true ); } 2084 2101 | ATassign initializer 2085 2102 { $$ = $2->set_maybeConstructed( false ); }
Note: See TracChangeset
for help on using the changeset viewer.