From 6850df5cafb5766a0511cc9a194b05e59816ecde Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 5 Oct 2020 13:05:45 +0200 Subject: lexer: properly handle reserved `if` word Signed-off-by: Jo-Philipp Wich --- lexer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lexer.c') 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 }, }; -- cgit v1.2.3