1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Having parenthesized let's us put these back to just expression

This commit is contained in:
Timothy Clem 2017-08-02 10:41:31 -07:00
parent 780663e06a
commit e7c8a9d6e2

View File

@ -317,19 +317,19 @@ assignment' :: Assignment
assignment'
= makeTerm <$> symbol Assignment <*> children (Statement.Assignment <$> lhs <*> rhs)
<|> makeTerm <$> symbol OperatorAssignment <*> children (lhs >>= \ var -> Statement.Assignment var <$>
(makeTerm <$> symbol AnonPlusEqual <*> (Expression.Plus var <$> expressions)
<|> makeTerm <$> symbol AnonMinusEqual <*> (Expression.Minus var <$> expressions)
<|> makeTerm <$> symbol AnonStarEqual <*> (Expression.Times var <$> expressions)
<|> makeTerm <$> symbol AnonStarStarEqual <*> (Expression.Power var <$> expressions)
<|> makeTerm <$> symbol AnonSlashEqual <*> (Expression.DividedBy var <$> expressions)
<|> makeTerm <$> symbol AnonPipePipeEqual <*> (Expression.And var <$> expressions)
<|> makeTerm <$> symbol AnonPipeEqual <*> (Expression.BOr var <$> expressions)
<|> makeTerm <$> symbol AnonAmpersandAmpersandEqual <*> (Expression.And var <$> expressions)
<|> makeTerm <$> symbol AnonAmpersandEqual <*> (Expression.BAnd var <$> expressions)
<|> makeTerm <$> symbol AnonPercentEqual <*> (Expression.Modulo var <$> expressions)
<|> makeTerm <$> symbol AnonRAngleRAngleEqual <*> (Expression.RShift var <$> expressions)
<|> makeTerm <$> symbol AnonLAngleLAngleEqual <*> (Expression.LShift var <$> expressions)
<|> makeTerm <$> symbol AnonCaretEqual <*> (Expression.BXOr var <$> expressions)))
(makeTerm <$> symbol AnonPlusEqual <*> (Expression.Plus var <$> expression)
<|> makeTerm <$> symbol AnonMinusEqual <*> (Expression.Minus var <$> expression)
<|> makeTerm <$> symbol AnonStarEqual <*> (Expression.Times var <$> expression)
<|> makeTerm <$> symbol AnonStarStarEqual <*> (Expression.Power var <$> expression)
<|> makeTerm <$> symbol AnonSlashEqual <*> (Expression.DividedBy var <$> expression)
<|> makeTerm <$> symbol AnonPipePipeEqual <*> (Expression.And var <$> expression)
<|> makeTerm <$> symbol AnonPipeEqual <*> (Expression.BOr var <$> expression)
<|> makeTerm <$> symbol AnonAmpersandAmpersandEqual <*> (Expression.And var <$> expression)
<|> makeTerm <$> symbol AnonAmpersandEqual <*> (Expression.BAnd var <$> expression)
<|> makeTerm <$> symbol AnonPercentEqual <*> (Expression.Modulo var <$> expression)
<|> makeTerm <$> symbol AnonRAngleRAngleEqual <*> (Expression.RShift var <$> expression)
<|> makeTerm <$> symbol AnonLAngleLAngleEqual <*> (Expression.LShift var <$> expression)
<|> makeTerm <$> symbol AnonCaretEqual <*> (Expression.BXOr var <$> expression)))
where
lhs = makeTerm <$> symbol LeftAssignmentList <*> children (many expr) <|> expr
rhs = makeTerm <$> symbol RightAssignmentList <*> children (many expr) <|> expr