Fix assignment priority
The assignment operator is lower priority than any other binary operator. Otherwise the following: ```tiger a := b | c ``` Would be parsed as: ```tiger (a := b) | c ``` Instead of the expected: ```tiger a := (b | c) ```
This commit is contained in:
parent
869b0bf79a
commit
21172e21e7
4 changed files with 1223 additions and 1203 deletions
16
test/corpus/regressions.txt
Normal file
16
test/corpus/regressions.txt
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
================================================================================
|
||||
Assignment precedence
|
||||
================================================================================
|
||||
|
||||
a := b | c
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment_expression
|
||||
(identifier)
|
||||
(operator)
|
||||
(binary_expression
|
||||
(identifier)
|
||||
(operator)
|
||||
(identifier))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue