summaryrefslogtreecommitdiff
path: root/test/lexer_test.c
diff options
context:
space:
mode:
authorCarlos Maniero <carlosmaniero@gmail.com>2023-04-25 03:52:59 -0300
committerJohnny Richard <johnny@johnnyrichard.com>2023-04-25 22:54:22 +0200
commitc1a1bd2320b4c1508c4ab20d23b7c193a94d8026 (patch)
treeea54aa17ba0223b9ff58087bdcb6af778186702e /test/lexer_test.c
parentcca2c345f9b16b88e1fc4e9ea598cf2f7ed8653a (diff)
parser: Add support for variables and identifiers in function body
This commit adds support for variables and identifiers in the function body of the parser, stored as a vector. However, at this point, identifier resolution is not fully implemented, and we currently accept identifiers without checking if they can be resolved. This is a known limitation that will be addressed in a future commit once hash-tables are added to the parser. Signed-off-by: Carlos Maniero <carlosmaniero@gmail.com> Reviewed-by: Johnny Richard <johnny@johnnyrichard.com>
Diffstat (limited to 'test/lexer_test.c')
-rw-r--r--test/lexer_test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/lexer_test.c b/test/lexer_test.c
index ae713b3..0eebfe5 100644
--- a/test/lexer_test.c
+++ b/test/lexer_test.c
@@ -71,6 +71,7 @@ test_tokenize_op(const MunitParameter params[],
assert_token_at(" - \n", 0, TOKEN_OP, "-");
assert_token_at(" * ;", 0, TOKEN_OP, "*");
assert_token_at(" / ", 0, TOKEN_OP, "/");
+ assert_token_at(" = ", 0, TOKEN_OP, "=");
assert_token_at("1 * 2", 0, TOKEN_NUMBER, "1");
assert_token_at("1 * 2", 1, TOKEN_OP, "*");