From a61627f333c6bac1b00036b9ad6bc80fd8c998bd Mon Sep 17 00:00:00 2001 From: James Eversole Date: Thu, 19 Dec 2024 21:13:57 -0600 Subject: [PATCH] Reserve __result keyword --- src/Lexer.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Lexer.hs b/src/Lexer.hs index 5ee1423..f5bdbea 100644 --- a/src/Lexer.hs +++ b/src/Lexer.hs @@ -25,8 +25,8 @@ keywordT = string "t" *> notFollowedBy alphaNumChar *> pure LKeywordT identifier :: Lexer LToken identifier = do name <- some (letterChar <|> char '_' <|> char '-') - if name == "t" - then fail "Keyword 't' cannot be used as an identifier" + if (name == "t" || name == "__result") + then fail "Keywords (`t`, `__result`) cannot be used as an identifier" else return (LIdentifier name) integerLiteral :: Lexer LToken