1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 13:51:44 +03:00

Contextualize inside assignments.

This commit is contained in:
Rob Rix 2017-08-14 17:09:04 -04:00
parent 5a4e497048
commit 3043434628

View File

@ -321,7 +321,7 @@ booleanOperator = makeTerm <$> symbol BooleanOperator <*> children ( expression
assignment' :: Assignment
assignment' = makeTerm <$> symbol Assignment <*> children (Statement.Assignment <$> expressionList <*> rvalue)
<|> makeTerm <$> symbol AugmentedAssignment <*> children (infixChoice expressionList rvalue
<|> makeTerm' <$> symbol AugmentedAssignment <*> children (infixTerm expressionList rvalue
[ assign Expression.Plus <$ symbol AnonPlusEqual
, assign Expression.Minus <$ symbol AnonMinusEqual
, assign Expression.Times <$ symbol AnonStarEqual
@ -336,8 +336,8 @@ assignment' = makeTerm <$> symbol Assignment <*> children (Statement.Assignment
, assign Expression.BXOr <$ symbol AnonCaretEqual
])
where rvalue = expressionList <|> assignment' <|> yield
assign :: f :< Syntax => (Term -> Term -> f Term) -> Term -> Term -> Statement.Assignment Term
assign c l r = Statement.Assignment l (makeTerm1 (c l r))
assign :: f :< Syntax => (Term -> Term -> f Term) -> Term -> Term -> Union Syntax Term
assign c l r = inj (Statement.Assignment l (makeTerm1 (c l r)))
yield :: Assignment
yield = makeTerm <$> symbol Yield <*> (Statement.Yield <$> children ( expression <|> emptyTerm ))