aboutsummaryrefslogtreecommitdiff
path: root/lex.go
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-08-30 18:53:44 +0200
committerHimbeer <himbeer@disroot.org>2024-08-30 18:53:44 +0200
commitfa461715a9a4fbca6bd012c0f2b8e35631ec12e8 (patch)
tree8982bb98b0737a8424cf9012ba9a6031f9754dd0 /lex.go
parent22786e52f6ed94424491660e33effd7173fd9279 (diff)
Add support for local constant and variable declarations
Diffstat (limited to 'lex.go')
-rw-r--r--lex.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/lex.go b/lex.go
index 6b76953..7450888 100644
--- a/lex.go
+++ b/lex.go
@@ -296,6 +296,10 @@ func addKeywordOrIdentifier(name string, line int) token {
return token{kind: function, line: line}
case "return":
return token{kind: ret, line: line}
+ case "const":
+ return token{kind: constKeyword, line: line}
+ case "mut":
+ return token{kind: mut, line: line}
default:
return token{kind: identifier, value: name, line: line}
}