1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Assign elsif blocks correctly.

This commit is contained in:
Rob Rix 2017-04-19 10:16:08 -04:00
parent e9a4f9e3a1
commit 69b0eeb18a

View File

@ -71,7 +71,8 @@ comment :: Assignment Grammar (Program a)
comment = wrapU . Comment.Comment <$ rule Comment <*> content
if' :: Assignment Grammar (Program a)
if' = wrapU <$ rule If <*> children (Statement.If <$> statement <*> (wrapU <$> many statement) <*> (wrapU <$ rule Else <*> children (many statement)))
if' = go If
where go symbol = wrapU <$ rule symbol <*> children (Statement.If <$> statement <*> (wrapU <$> many statement) <*> (go Elsif <|> wrapU <$ rule Else <*> children (many statement)))
expr :: Assignment Grammar (Program a)
expr = if' <|> literal