mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Ruby case can be empty
This commit is contained in:
parent
473e7e34dd
commit
6f9836c103
@ -279,7 +279,7 @@ for = makeTerm <$> symbol For <*> children (forStatement <*> expressions)
|
||||
Statement.ForEach <$> (flip makeTerm (reverse rest) <$> location) <*> (pure x)
|
||||
|
||||
case' :: Assignment
|
||||
case' = makeTerm <$> symbol Case <*> children (Statement.Match <$> expression <*> whens)
|
||||
case' = makeTerm <$> symbol Case <*> children (Statement.Match <$> (expression <|> emptyTerm) <*> whens)
|
||||
where
|
||||
whens = makeTerm <$> location <*> many (when' <|> else' <|> expressions)
|
||||
when' = makeTerm <$> symbol When <*> children (Statement.Pattern <$> (makeTerm <$> location <*> some pattern) <*> whens)
|
||||
|
Loading…
Reference in New Issue
Block a user