1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00
This commit is contained in:
Timothy Clem 2017-06-23 13:49:18 -06:00
parent 95011b42ea
commit 8cdb0bf213

View File

@ -91,6 +91,7 @@ statement = -- handleError $
<|> unary
<|> binary
<|> literal
<|> keywords
<|> mk Return Statement.Return
<|> mk Yield Statement.Yield
<|> mk Break Statement.Break
@ -144,6 +145,14 @@ literal =
where
pairs = makeTerm <$> symbol Pair <*> children (Literal.KeyValue <$> statement <*> statement)
keywords :: Assignment
keywords =
mk KeywordFILE
<|> mk KeywordLINE
<|> mk KeywordENCODING
-- TODO: Give keywords their own Expression?
where mk s = makeTerm <$> symbol s <*> (Literal.TextElement <$> source)
beginBlock :: Assignment
beginBlock = makeTerm <$> symbol BeginBlock <*> children (Statement.ScopeEntry <$> many topLevelStatement)