mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Assign until statements.
This commit is contained in:
parent
5ab78c37b9
commit
8aad196202
@ -78,6 +78,7 @@ statement = exit Statement.Return Return
|
||||
<|> unlessModifier
|
||||
<|> while
|
||||
<|> whileModifier
|
||||
<|> until
|
||||
<|> literal
|
||||
where exit construct sym = symbol sym *> term <*> (children (construct <$> optional (symbol ArgumentList *> children statement)))
|
||||
|
||||
@ -103,6 +104,9 @@ while = symbol While *> term <*> children (Statement.While <$> statement <*> (te
|
||||
whileModifier :: Assignment (Node Grammar) (Term Syntax Location)
|
||||
whileModifier = symbol WhileModifier *> term <*> children (flip Statement.While <$> statement <*> statement)
|
||||
|
||||
until :: Assignment (Node Grammar) (Term Syntax Location)
|
||||
until = symbol Until *> term <*> children (Statement.While <$> (term <*> (Expression.Not <$> statement)) <*> (term <*> many statement))
|
||||
|
||||
literal :: Assignment (Node Grammar) (Term Syntax Location)
|
||||
literal = leaf Language.Ruby.Syntax.True (const Literal.true)
|
||||
<|> leaf Language.Ruby.Syntax.False (const Literal.false)
|
||||
|
Loading…
Reference in New Issue
Block a user