Update grammar to reflect correct operator precedence.
This commit is contained in:
parent
e795664a09
commit
fe2fff5882
@ -596,38 +596,52 @@ Expression = {
|
|||||||
|
|
||||||
TernaryExpression = {
|
TernaryExpression = {
|
||||||
OrExpression
|
OrExpression
|
||||||
~ (
|
~ TernaryRhs*
|
||||||
TernaryTrueAlternative
|
}
|
||||||
~ TernaryFalseAlternative
|
|
||||||
)?
|
TernaryRhs = {
|
||||||
|
TernaryTrueAlternative
|
||||||
|
~ TernaryFalseAlternative
|
||||||
}
|
}
|
||||||
|
|
||||||
TernaryTrueAlternative = {
|
TernaryTrueAlternative = {
|
||||||
"?"
|
"?"
|
||||||
~ Expression
|
~ OrExpression
|
||||||
}
|
}
|
||||||
|
|
||||||
TernaryFalseAlternative = {
|
TernaryFalseAlternative = {
|
||||||
":"
|
":"
|
||||||
~ Expression
|
~ OrExpression
|
||||||
}
|
}
|
||||||
|
|
||||||
OrExpression = {
|
OrExpression = {
|
||||||
AndExpression
|
AndExpression
|
||||||
~ ( Or ~ Expression )?
|
~ OrRhs*
|
||||||
|
}
|
||||||
|
|
||||||
|
OrRhs = {
|
||||||
|
Or
|
||||||
|
~ AndExpression
|
||||||
}
|
}
|
||||||
|
|
||||||
AndExpression = {
|
AndExpression = {
|
||||||
ComparisonExpression
|
ComparisonExpression
|
||||||
~ ( And ~ Expression )?
|
~ AndRhs*
|
||||||
|
}
|
||||||
|
|
||||||
|
AndRhs = {
|
||||||
|
And
|
||||||
|
~ ComparisonExpression
|
||||||
}
|
}
|
||||||
|
|
||||||
ComparisonExpression = {
|
ComparisonExpression = {
|
||||||
ShiftExpression
|
ShiftExpression
|
||||||
~ (
|
~ ComparisonRhs*
|
||||||
ComparisonOperator
|
}
|
||||||
~ Expression
|
|
||||||
)?
|
ComparisonRhs = {
|
||||||
|
ComparisonOperator
|
||||||
|
~ Expression
|
||||||
}
|
}
|
||||||
|
|
||||||
ComparisonOperator = {
|
ComparisonOperator = {
|
||||||
@ -641,10 +655,12 @@ ComparisonOperator = {
|
|||||||
|
|
||||||
ShiftExpression = {
|
ShiftExpression = {
|
||||||
AdditiveExpression
|
AdditiveExpression
|
||||||
~ (
|
~ ShiftRhs*
|
||||||
ShiftOperator
|
}
|
||||||
~ Expression
|
|
||||||
)?
|
ShiftRhs = {
|
||||||
|
ShiftOperator
|
||||||
|
~ AdditiveExpression
|
||||||
}
|
}
|
||||||
|
|
||||||
ShiftOperator = {
|
ShiftOperator = {
|
||||||
@ -654,10 +670,12 @@ ShiftOperator = {
|
|||||||
|
|
||||||
AdditiveExpression = {
|
AdditiveExpression = {
|
||||||
MultiplicativeExpression
|
MultiplicativeExpression
|
||||||
~ (
|
~ AdditiveRhs*
|
||||||
AdditiveOperator
|
}
|
||||||
~ Expression
|
|
||||||
)?
|
AdditiveRhs = {
|
||||||
|
AdditiveOperator
|
||||||
|
~ MultiplicativeExpression
|
||||||
}
|
}
|
||||||
|
|
||||||
AdditiveOperator = {
|
AdditiveOperator = {
|
||||||
@ -667,10 +685,12 @@ AdditiveOperator = {
|
|||||||
|
|
||||||
MultiplicativeExpression = {
|
MultiplicativeExpression = {
|
||||||
PrefixExpression
|
PrefixExpression
|
||||||
~ (
|
~ MultiplicativeRhs*
|
||||||
MultiplicativeOperator
|
}
|
||||||
~ Expression
|
|
||||||
)?
|
MultiplicativeRhs = {
|
||||||
|
MultiplicativeOperator
|
||||||
|
~ PrefixExpression
|
||||||
}
|
}
|
||||||
|
|
||||||
MultiplicativeOperator = {
|
MultiplicativeOperator = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user