Changes in src/Parser/parser.yy [1d71208:15f769c]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r1d71208 r15f769c 635 635 postfix_expression: 636 636 primary_expression 637 | postfix_expression '[' assignment_expression ',' tuple_expression_list ']' 638 // Historic, transitional: Disallow commas in subscripts. 639 // Switching to this behaviour may help check if a C compatibilty case uses comma-exprs in subscripts. 640 // { SemanticError( yylloc, "New array subscript is currently unimplemented." ); $$ = nullptr; } 641 // Current: Commas in subscripts make tuples. 642 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, new ExpressionNode( build_tuple( (ExpressionNode *)($3->set_last( $5 ) ) )) ) ); } 637 | postfix_expression '[' assignment_expression ',' comma_expression ']' 638 // { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, new ExpressionNode( build_binary_val( OperKinds::Index, $3, $5 ) ) ) ); } 639 { SemanticError( yylloc, "New array subscript is currently unimplemented." ); $$ = nullptr; } 643 640 | postfix_expression '[' assignment_expression ']' 644 641 // CFA, comma_expression disallowed in this context because it results in a common user error: subscripting a
Note:
See TracChangeset
for help on using the changeset viewer.