1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +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, augmentedAssignmentExpression,
conditionalExpression, conditionalExpression,
yieldExpression, yieldExpression,
unaryExpression,
binaryExpression,
includeExpression, includeExpression,
includeOnceExpression, includeOnceExpression,
requireExpression, requireExpression,
requireOnceExpression requireOnceExpression,
binaryExpression,
unaryExpression
] ]
unaryExpression :: Assignment unaryExpression :: Assignment
unaryExpression = choice [ unaryExpression = choice [
cloneExpression, cloneExpression,
primaryExpression,
exponentiationExpression, exponentiationExpression,
unaryOpExpression, unaryOpExpression,
castExpression castExpression,
primaryExpression
] ]
assignmentExpression :: Assignment assignmentExpression :: Assignment
@ -257,8 +257,10 @@ primaryExpression = choice [
anonymousFunctionCreationExpression, anonymousFunctionCreationExpression,
objectCreationExpression, objectCreationExpression,
updateExpression, updateExpression,
shellCommandExpression, shellCommandExpression
expression -- | 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 classConstantAccessExpression :: Assignment