|
65 | 65 | %right BITWISE_NOT . |
66 | 66 | %right PARENTHESES_CLOSE . |
67 | 67 | %right SBRACKET_OPEN . |
68 | | -%left ARROW . |
| 68 | +%right ARROW . |
69 | 69 |
|
70 | 70 | // The following text is included near the beginning of the C source |
71 | 71 | // code file that implements the parser. |
@@ -464,6 +464,10 @@ xx_class_definition(R) ::= xx_class_properties_definition(C) xx_class_consts_def |
464 | 464 | xx_ret_class_definition(&R, &C, &M, &K, status->scanner_state); |
465 | 465 | } |
466 | 466 |
|
| 467 | +xx_class_definition(R) ::= xx_class_consts_definition(K) xx_class_properties_definition(C) xx_class_methods_definition(M) . { |
| 468 | + xx_ret_class_definition(&R, &C, &M, &K, status->scanner_state); |
| 469 | +} |
| 470 | + |
467 | 471 | xx_interface_definition(R) ::= xx_class_consts_definition(C) . { |
468 | 472 | xx_ret_interface_definition(&R, NULL, &C, status->scanner_state); |
469 | 473 | } |
@@ -1397,10 +1401,6 @@ xx_for_statement(R) ::= FOR IDENTIFIER(K) COMMA IDENTIFIER(V) IN REVERSE xx_comm |
1397 | 1401 | xx_ret_for_statement(&R, &E, K, V, 1, &L, status->scanner_state); |
1398 | 1402 | } |
1399 | 1403 |
|
1400 | | -xx_for_statement(R) ::= FOR IDENTIFIER(K) COMMA IDENTIFIER(V) IN REVERSE xx_common_expr(E) BRACKET_OPEN BRACKET_CLOSE . { |
1401 | | - xx_ret_for_statement(&R, &E, K, V, 1, NULL, status->scanner_state); |
1402 | | -} |
1403 | | - |
1404 | 1404 | xx_for_statement(R) ::= FOR PARENTHESES_OPEN IDENTIFIER(V) IN xx_common_expr(E) PARENTHESES_CLOSE BRACKET_OPEN xx_statement_list(L) BRACKET_CLOSE . { |
1405 | 1405 | xx_ret_for_statement(&R, &E, NULL, V, 0, &L, status->scanner_state); |
1406 | 1406 | } |
@@ -1523,13 +1523,12 @@ xx_let_assignment(R) ::= IDENTIFIER(D) ARROW IDENTIFIER(I) SBRACKET_OPEN SBRACKE |
1523 | 1523 | } |
1524 | 1524 |
|
1525 | 1525 | /* y->x[z][] = {expr} */ |
1526 | | -xx_let_assignment(R) ::= IDENTIFIER(D) ARROW IDENTIFIER(I) xx_array_offset_list(X) SBRACKET_OPEN SBRACKET_CLOSE xx_assignment_operator(O) xx_assign_expr(E) . { |
1527 | | - xx_ret_let_assignment(&R, "object-property-array-index-append", &O, D, I, &X, &E, status->scanner_state); |
| 1526 | +xx_let_assignment(R) ::= IDENTIFIER(D) ARROW IDENTIFIER(I) xx_array_offset_list(X) xx_assignment_operator(O) xx_assign_expr(E) . { |
| 1527 | + xx_ret_let_assignment(&R, "object-property-array-index", &O, D, I, &X, &E, status->scanner_state); |
1528 | 1528 | } |
1529 | 1529 |
|
1530 | | -/* {expr}->x = {expr} (nested property access) */ |
1531 | | -xx_let_assignment(R) ::= xx_common_expr(V) ARROW IDENTIFIER(I) xx_assignment_operator(O) xx_assign_expr(E) . { |
1532 | | - xx_ret_let_property_access_assignment(&R, &O, &V, I, &E, status->scanner_state); |
| 1530 | +xx_let_assignment(R) ::= IDENTIFIER(D) ARROW IDENTIFIER(I) xx_array_offset_list(X) SBRACKET_OPEN SBRACKET_CLOSE xx_assignment_operator(O) xx_assign_expr(E) . { |
| 1531 | + xx_ret_let_assignment(&R, "object-property-array-index-append", &O, D, I, &X, &E, status->scanner_state); |
1533 | 1532 | } |
1534 | 1533 |
|
1535 | 1534 | /* y::x = {expr} */ |
@@ -1995,11 +1994,11 @@ xx_common_expr(R) ::= xx_common_expr(O1) EXCLUSIVE_RANGE xx_common_expr(O2) . { |
1995 | 1994 | } |
1996 | 1995 |
|
1997 | 1996 | /* y = fetch x, z[k] */ |
1998 | | -xx_fetch_expr(R) ::= FETCH IDENTIFIER(O1) COMMA xx_common_expr(E2) . { |
| 1997 | +xx_fetch_expr(R) ::= FETCH IDENTIFIER(O1) COMMA xx_common_expr(O2) . { |
1999 | 1998 | { |
2000 | 1999 | zval identifier; |
2001 | 2000 | xx_ret_literal(&identifier, XX_T_IDENTIFIER, O1, status->scanner_state); |
2002 | | - xx_ret_expr(&R, "fetch", &identifier, &E2, NULL, status->scanner_state); |
| 2001 | + xx_ret_expr(&R, "fetch", &identifier, &O2, NULL, status->scanner_state); |
2003 | 2002 | } |
2004 | 2003 | } |
2005 | 2004 |
|
|
0 commit comments