Changeset d824715
- Timestamp:
- Mar 14, 2022, 4:52:35 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 33b7d49
- Parents:
- c7f2d9b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rc7f2d9b rd824715 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Feb 25 17:54:56202213 // Update Count : 52 6212 // Last Modified On : Mon Mar 14 16:35:29 2022 13 // Update Count : 5276 14 14 // 15 15 … … 652 652 // Historic, transitional: Disallow commas in subscripts. 653 653 // Switching to this behaviour may help check if a C compatibilty case uses comma-exprs in subscripts. 654 // { SemanticError( yylloc, "New array subscript is currently unimplemented." ); $$ = nullptr; }655 654 // Current: Commas in subscripts make tuples. 656 655 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, new ExpressionNode( build_tuple( (ExpressionNode *)($3->set_last( $5 ) ) )) ) ); } … … 661 660 // equivalent to the old x[i,j]. 662 661 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $3 ) ); } 662 | constant '[' assignment_expression ']' // 3[a], 'a'[a], 3.5[a] 663 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $3 ) ); } 664 | string_literal '[' assignment_expression ']' // "abc"[3], 3["abc"] 665 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, new ExpressionNode( $1 ), $3 ) ); } 663 666 | postfix_expression '{' argument_expression_list_opt '}' // CFA, constructor call 664 667 {
Note: See TracChangeset
for help on using the changeset viewer.