1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Assign until modifiers.

This commit is contained in:
Rob Rix 2017-05-01 16:38:35 -04:00
parent 8aad196202
commit 20109d2705

View File

@ -79,6 +79,7 @@ statement = exit Statement.Return Return
<|> while
<|> whileModifier
<|> until
<|> untilModifier
<|> literal
where exit construct sym = symbol sym *> term <*> (children (construct <$> optional (symbol ArgumentList *> children statement)))
@ -107,6 +108,9 @@ whileModifier = symbol WhileModifier *> term <*> children (flip Statement.While
until :: Assignment (Node Grammar) (Term Syntax Location)
until = symbol Until *> term <*> children (Statement.While <$> (term <*> (Expression.Not <$> statement)) <*> (term <*> many statement))
untilModifier :: Assignment (Node Grammar) (Term Syntax Location)
untilModifier = symbol UntilModifier *> term <*> children (flip Statement.While <$> statement <*> (term <*> (Expression.Not <$> 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)