summaryrefslogtreecommitdiffhomepage
path: root/lexer.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-05 13:05:45 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-05 13:05:45 +0200
commit6850df5cafb5766a0511cc9a194b05e59816ecde (patch)
treef007a6c2452abc240a950f4dac995ff100f01735 /lexer.c
parentb1391241a116d794a091c97bbb63b485f6514fb7 (diff)
lexer: properly handle reserved `if` word
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lexer.c b/lexer.c
index ad7ac46..810e2eb 100644
--- a/lexer.c
+++ b/lexer.c
@@ -75,7 +75,6 @@ static const struct token tokens[] = {
{ T_ASSUB, "-=", 2 },
{ T_DEC, "--", 2 },
{ T_INC, "++", 2 },
- { T_IF, "if", 2 },
{ T_EQ, "==", 2 },
{ T_NE, "!=", 2 },
{ T_LE, "<=", 2 },
@@ -146,6 +145,7 @@ static const struct token reserved_words[] = {
{ T_NUMBER, "NaN", 3, parse_number },
{ T_TRY, "try", 3 },
{ T_FOR, "for", 3 },
+ { T_IF, "if", 2 },
{ T_IN, "in", 2 },
};