mirror of
https://github.com/github/semantic.git
synced 2025-01-08 08:30:27 +03:00
Slightly different ForEach structure
This commit is contained in:
parent
61e0d8b83e
commit
4a553ff4fa
src
@ -102,7 +102,7 @@ data For a = For { forBefore :: !a, forCondition :: !a, forStep :: !a, forBody :
|
||||
instance Eq1 For where liftEq = genericLiftEq
|
||||
instance Show1 For where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
data ForEach a = ForEach { forEachBinding :: ![a], forEachSubject :: !a, forEachBody :: !a }
|
||||
data ForEach a = ForEach { forEachBinding :: !a, forEachSubject :: !a, forEachBody :: !a }
|
||||
deriving (Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable)
|
||||
|
||||
instance Eq1 ForEach where liftEq = genericLiftEq
|
||||
|
@ -255,7 +255,8 @@ until' =
|
||||
<|> makeTerm <$> symbol UntilModifier <*> children (flip Statement.While <$> statement <*> invert statement)
|
||||
|
||||
for :: Assignment
|
||||
for = makeTerm <$> symbol For <*> children (Statement.ForEach <$> some identifier <*> statement <*> statements)
|
||||
for = makeTerm <$> symbol For <*> children (Statement.ForEach <$> vars <*> statement <*> statements)
|
||||
where vars = makeTerm <$> location <*> some identifier
|
||||
|
||||
case' :: Assignment
|
||||
case' = makeTerm <$> symbol Case <*> children (Statement.Match <$> statement <*> when)
|
||||
|
Loading…
Reference in New Issue
Block a user