1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

Prevent assignment from infinite looping by removing expression from primary_expression

This commit is contained in:
joshvera 2018-01-17 17:32:54 -05:00
parent 15085a4c4b
commit 3ae16fb1ff

View File

@ -171,21 +171,21 @@ expression = choice [
augmentedAssignmentExpression,
conditionalExpression,
yieldExpression,
unaryExpression,
binaryExpression,
includeExpression,
includeOnceExpression,
requireExpression,
requireOnceExpression
requireOnceExpression,
binaryExpression,
unaryExpression
]
unaryExpression :: Assignment
unaryExpression = choice [
cloneExpression,
primaryExpression,
exponentiationExpression,
unaryOpExpression,
castExpression
castExpression,
primaryExpression
]
assignmentExpression :: Assignment
@ -257,8 +257,10 @@ primaryExpression = choice [
anonymousFunctionCreationExpression,
objectCreationExpression,
updateExpression,
shellCommandExpression,
expression
shellCommandExpression
-- | TODO Add expression back so we can parse '(', expression, ')' as a primary expression.
-- | Leaving this in here causes assignment to infinite loop.
-- expression
]
classConstantAccessExpression :: Assignment