1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

Fix augmented assignment in Go

This commit is contained in:
Timothy Clem 2019-12-18 13:52:42 -08:00
parent 80ab58bd7f
commit 5d271a8f49
2 changed files with 2 additions and 1 deletions

View File

@ -454,7 +454,7 @@ assignment' = makeTerm' <$> symbol AssignmentStatement <*> children (infixTerm
assign l r = inject (Statement.Assignment [] l r)
augmentedAssign :: (f :< Go.Syntax) => (Term Loc -> Term Loc -> f (Term Loc)) -> Term Loc -> Term Loc -> Sum Go.Syntax (Term Loc)
augmentedAssign c l r = assign l (makeTerm1 (c l r))
augmentedAssign c l r = inject (Statement.AugmentedAssignment (makeTerm1 (c l r)))
invert cons a b = Expression.Not (makeTerm1 (cons a b))

View File

@ -104,6 +104,7 @@ type Syntax =
, Literal.Reference
, Literal.TextElement
, Statement.Assignment
, Statement.AugmentedAssignment
, Statement.Break
, Statement.Continue
, Statement.For