Report the unexpected token for P_UNEXPECTED_TOKEN returns - close #11

This commit is contained in:
josh committed 2023-07-28 15:42:18 -04:00
1 parent fa7a781a5d
commit fff9700f91
3 files changed
+8

No files matched your search

+2
View File
@@ -17,11 +17,13 @@ unittest
p_context_init(&context, input);
assert(p_parse(&context) == P_UNEXPECTED_TOKEN);
assert(p_position(&context) == p_position_t(2, 3));
assert(context.token == TOKEN_a);
input = "12";
p_context_init(&context, input);
assert(p_parse(&context) == P_UNEXPECTED_TOKEN);
assert(p_position(&context) == p_position_t(0, 0));
assert(context.token == TOKEN_num);
input = "a 12\n\nab";
p_context_init(&context, input);
@@ -13,6 +13,7 @@ unittest
p_context_init(&context, input);
assert(p_parse(&context) == P_UNEXPECTED_TOKEN);
assert(p_position(&context) == p_position_t(0, 1));
assert(context.token == TOKEN___EOF);
input = "a b";
p_context_init(&context, input);