summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-11-10 12:53:17 +0100
committerJo-Philipp Wich <jo@mein.io>2020-11-10 12:53:17 +0100
commit0e1b863228ad05774a390493087b3901fa82b31b (patch)
treebb12330a31e1dbf0b98ffcb47de8c0f19c742af6
parent41385a0381a89516fd99989aa3a7dd84c6c33d64 (diff)
lexer: accept "let" as synonym for "local"
This brings the utpl script syntax closer to ES5/ES6 and allows to use existing syntax highlightings in IDEs and editors. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--lexer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lexer.c b/lexer.c
index 3555927..31a4daf 100644
--- a/lexer.c
+++ b/lexer.c
@@ -152,6 +152,7 @@ static const struct token reserved_words[] = {
{ T_DOUBLE, "NaN", 3, { .d = NAN } },
{ T_TRY, "try", 3 },
{ T_FOR, "for", 3 },
+ { T_LOCAL, "let", 3 },
{ T_IF, "if", 2 },
{ T_IN, "in", 2 },
};