1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Assign -=.

This commit is contained in:
Rob Rix 2017-05-03 11:27:03 -04:00
parent b8bd18e742
commit 3b54a4ebf3

View File

@ -23,6 +23,7 @@ type Syntax' =
'[Comment.Comment
, Declaration.Class
, Declaration.Method
, Expression.Minus
, Expression.Not
, Expression.Plus
, Literal.Array
@ -84,7 +85,9 @@ statement = exit Statement.Return Return
<|> until
<|> for
<|> literal
<|> symbol OperatorAssignment *> term <*> children (lvalue >>= \ var -> Statement.Assignment var <$ symbol AnonPlusEqual <*> (term <*> (Expression.Plus var <$> expression)))
<|> symbol OperatorAssignment *> term <*> children (lvalue >>= \ var -> Statement.Assignment var <$>
( symbol AnonPlusEqual *> term <*> (Expression.Plus var <$> expression)
<|> symbol AnonMinusEqual *> term <*> (Expression.Minus var <$> expression)))
where exit construct sym = symbol sym *> term <*> children (construct <$> optional (symbol ArgumentList *> children statement))
lvalue :: Assignment (Node Grammar) (Term Syntax Location)