|
65 | 65 | %right BITWISE_NOT . |
66 | 66 | %right PARENTHESES_CLOSE . |
67 | 67 | %right SBRACKET_OPEN . |
68 | | -%right ARROW . |
| 68 | +%left 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,10 +464,6 @@ 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 | | - |
471 | 467 | xx_interface_definition(R) ::= xx_class_consts_definition(C) . { |
472 | 468 | xx_ret_interface_definition(&R, NULL, &C, status->scanner_state); |
473 | 469 | } |
@@ -1401,6 +1397,10 @@ xx_for_statement(R) ::= FOR IDENTIFIER(K) COMMA IDENTIFIER(V) IN REVERSE xx_comm |
1401 | 1397 | xx_ret_for_statement(&R, &E, K, V, 1, &L, status->scanner_state); |
1402 | 1398 | } |
1403 | 1399 |
|
| 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,14 +1523,15 @@ 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) 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 | | -} |
1529 | | - |
1530 | 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) . { |
1531 | 1527 | xx_ret_let_assignment(&R, "object-property-array-index-append", &O, D, I, &X, &E, status->scanner_state); |
1532 | 1528 | } |
1533 | 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); |
| 1533 | +} |
| 1534 | + |
1534 | 1535 | /* y::x = {expr} */ |
1535 | 1536 | xx_let_assignment(R) ::= IDENTIFIER(D) DOUBLECOLON IDENTIFIER(I) xx_assignment_operator(O) xx_assign_expr(E) . { |
1536 | 1537 | xx_ret_let_assignment(&R, "static-property", &O, D, I, NULL, &E, status->scanner_state); |
@@ -1994,11 +1995,11 @@ xx_common_expr(R) ::= xx_common_expr(O1) EXCLUSIVE_RANGE xx_common_expr(O2) . { |
1994 | 1995 | } |
1995 | 1996 |
|
1996 | 1997 | /* y = fetch x, z[k] */ |
1997 | | -xx_fetch_expr(R) ::= FETCH IDENTIFIER(O1) COMMA xx_common_expr(O2) . { |
| 1998 | +xx_fetch_expr(R) ::= FETCH IDENTIFIER(O1) COMMA xx_common_expr(E2) . { |
1998 | 1999 | { |
1999 | 2000 | zval identifier; |
2000 | 2001 | xx_ret_literal(&identifier, XX_T_IDENTIFIER, O1, status->scanner_state); |
2001 | | - xx_ret_expr(&R, "fetch", &identifier, &O2, NULL, status->scanner_state); |
| 2002 | + xx_ret_expr(&R, "fetch", &identifier, &E2, NULL, status->scanner_state); |
2002 | 2003 | } |
2003 | 2004 | } |
2004 | 2005 |
|
|
0 commit comments