summaryrefslogtreecommitdiffhomepage
path: root/lexer.h
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-05-18 14:18:04 +0200
committerJo-Philipp Wich <jo@mein.io>2021-05-18 16:09:36 +0200
commit5714705aee31a0d561b4cf1b8096bbe19e17a825 (patch)
tree1c249365983089fb249b1f109f13ed3a590863d0 /lexer.h
parent2c2e603204be7ec96cab7504e3ee6951412ad4bc (diff)
syntax: introduce `const` support
Introduce support for declaring constant variables through the `const` keyword. Variables declared with `const` follow the same scoping rules as `let` declared ones. In contrast to normal variables, `const` ones may not be assigned to after their declaration. Any attempt to do so will result in a syntax error during compilation. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lexer.h')
-rw-r--r--lexer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lexer.h b/lexer.h
index e31f78a..96cdff8 100644
--- a/lexer.h
+++ b/lexer.h
@@ -104,6 +104,7 @@ typedef enum {
TK_NULL,
TK_THIS,
TK_DELETE,
+ TK_CONST,
TK_EOF,
TK_ERROR