Refactor parser
This commit is contained in:
@@ -97,3 +97,17 @@ static void test_tokenstream_info(void) {
|
||||
if (t2.location.line != 1) fail("expected line 1");
|
||||
if (t2.location.column_start != 8) fail("expected column 8");
|
||||
}
|
||||
|
||||
static void test_tokenstream_primitive_types(void) {
|
||||
TokenStream* ts = test_get_tokenstream();
|
||||
|
||||
if (tokenstream_next(ts).token != TOKEN_I8) fail("expected TOKEN_I8");
|
||||
if (tokenstream_next(ts).token != TOKEN_I16) fail("expected TOKEN_I16");
|
||||
if (tokenstream_next(ts).token != TOKEN_I32) fail("expected TOKEN_I32");
|
||||
if (tokenstream_next(ts).token != TOKEN_I64) fail("expected TOKEN_I64");
|
||||
if (tokenstream_next(ts).token != TOKEN_U8) fail("expected TOKEN_U8");
|
||||
if (tokenstream_next(ts).token != TOKEN_U16) fail("expected TOKEN_U16");
|
||||
if (tokenstream_next(ts).token != TOKEN_U32) fail("expected TOKEN_U32");
|
||||
if (tokenstream_next(ts).token != TOKEN_U64) fail("expected TOKEN_U64");
|
||||
if (tokenstream_next(ts).token != TOKEN_EOF) fail("expected EOF");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user