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