Commit a1992db
authored
Fix parsing of arrow expressions in ternaries. (rescript-lang#367)
Arrow functions in the "ternary true branch" where picked up as nested arrows:
`x ? y => () : onChange` for the parser was `x ? y => (() : onChange => …)`
The fix is to pass the right context through.
Fixes rescript-lang/syntax#3631 parent a6e733e commit a1992db
File tree
4 files changed
+12
-3
lines changed- syntax
- src
- tests/printer/expr
- __snapshots__
- expected
4 files changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1576 | 1576 | | |
1577 | 1577 | | |
1578 | 1578 | | |
1579 | | - | |
| 1579 | + | |
1580 | 1580 | | |
1581 | 1581 | | |
1582 | 1582 | | |
| |||
1592 | 1592 | | |
1593 | 1593 | | |
1594 | 1594 | | |
1595 | | - | |
| 1595 | + | |
1596 | 1596 | | |
1597 | 1597 | | |
1598 | 1598 | | |
| |||
2108 | 2108 | | |
2109 | 2109 | | |
2110 | 2110 | | |
2111 | | - | |
| 2111 | + | |
2112 | 2112 | | |
2113 | 2113 | | |
2114 | 2114 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4037 | 4037 | | |
4038 | 4038 | | |
4039 | 4039 | | |
| 4040 | + | |
| 4041 | + | |
| 4042 | + | |
4040 | 4043 | | |
4041 | 4044 | | |
4042 | 4045 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
0 commit comments