Fix parser to allow binary operators for binding syntax (#3326)

Previously, the precedence of `as` binding was higher than the binary
operators. This results in unexpected behaviors, `1 + 2 as $x | -$x`
was `-1` instead of `-3`. The commit 92daac90f6 (PR #3053) changed
the behavior to emit syntax error on this case. Now, this commit allows
binary operators with `as` binding. This fixes #2446, and fixes #3284.
This commit is contained in:
itchyny authored and GitHub committed 2025-05-23 21:25:30 +09:00
1 parent 4e3088f188
commit aaace5432a
3 files changed
+522 -524

No files matched your search

Generated
+513 -523
View File
File diff suppressed because it is too large. Load diff