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
|
|
@ -412,7 +412,7 @@
|
|||
"members": [
|
||||
{
|
||||
"type": "PREC_LEFT",
|
||||
"value": 5,
|
||||
"value": 6,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
|
@ -459,7 +459,7 @@
|
|||
},
|
||||
{
|
||||
"type": "PREC_LEFT",
|
||||
"value": 4,
|
||||
"value": 5,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
|
@ -506,7 +506,7 @@
|
|||
},
|
||||
{
|
||||
"type": "PREC_LEFT",
|
||||
"value": 3,
|
||||
"value": 4,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
|
@ -569,7 +569,7 @@
|
|||
},
|
||||
{
|
||||
"type": "PREC_LEFT",
|
||||
"value": 2,
|
||||
"value": 3,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
|
@ -607,7 +607,7 @@
|
|||
},
|
||||
{
|
||||
"type": "PREC_LEFT",
|
||||
"value": 1,
|
||||
"value": 2,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
|
@ -830,7 +830,7 @@
|
|||
},
|
||||
"assignment_expression": {
|
||||
"type": "PREC_RIGHT",
|
||||
"value": 6,
|
||||
"value": 1,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
|
|
|||
2386
src/parser.c
2386
src/parser.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue