Refactor Token to use Location struct
This commit is contained in:
+4
-4
@@ -101,8 +101,8 @@ static void test_tokenstream_info(void) {
|
||||
memcpy(buf1, t1.text, t1.text_length);
|
||||
buf1[t1.text_length] = '\0';
|
||||
assert_str("module", buf1, "info: expected 'module'");
|
||||
if (t1.line != 1) fail("expected line 1");
|
||||
if (t1.column != 1) fail("expected column 1");
|
||||
if (t1.location.line != 1) fail("expected line 1");
|
||||
if (t1.location.column != 1) fail("expected column 1");
|
||||
|
||||
Token t2 = tokenstream_next(ts);
|
||||
if (t2.token != TOKEN_IDENTIFIER) fail("expected TOKEN_IDENTIFIER");
|
||||
@@ -111,8 +111,8 @@ static void test_tokenstream_info(void) {
|
||||
memcpy(buf2, t2.text, t2.text_length);
|
||||
buf2[t2.text_length] = '\0';
|
||||
assert_str("main", buf2, "info: expected 'main'");
|
||||
if (t2.line != 1) fail("expected line 1");
|
||||
if (t2.column != 8) fail("expected column 8");
|
||||
if (t2.location.line != 1) fail("expected line 1");
|
||||
if (t2.location.column != 8) fail("expected column 8");
|
||||
|
||||
tokenstream_close(ts);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user