Reserve __result keyword
This commit is contained in:
parent
2399830366
commit
a61627f333
@ -25,8 +25,8 @@ keywordT = string "t" *> notFollowedBy alphaNumChar *> pure LKeywordT
|
|||||||
identifier :: Lexer LToken
|
identifier :: Lexer LToken
|
||||||
identifier = do
|
identifier = do
|
||||||
name <- some (letterChar <|> char '_' <|> char '-')
|
name <- some (letterChar <|> char '_' <|> char '-')
|
||||||
if name == "t"
|
if (name == "t" || name == "__result")
|
||||||
then fail "Keyword 't' cannot be used as an identifier"
|
then fail "Keywords (`t`, `__result`) cannot be used as an identifier"
|
||||||
else return (LIdentifier name)
|
else return (LIdentifier name)
|
||||||
|
|
||||||
integerLiteral :: Lexer LToken
|
integerLiteral :: Lexer LToken
|
||||||
|
Loading…
x
Reference in New Issue
Block a user