mirror of
https://github.com/github/semantic.git
synced 2024-12-21 22:01:46 +03:00
Keywords
This commit is contained in:
parent
95011b42ea
commit
8cdb0bf213
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user