feat 重构stream流API并适配lex_parse和lexer
This commit is contained in:
@@ -63,9 +63,9 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
smcc_lexer_t lexer;
|
||||
core_mem_stream_t mem_stream = {0};
|
||||
core_stream_t *stream =
|
||||
core_mem_stream_init(&mem_stream, buffer, fsize, false);
|
||||
core_mem_probe_stream_t mem_stream = {0};
|
||||
core_probe_stream_t *stream =
|
||||
core_mem_probe_stream_init(&mem_stream, buffer, fsize, false);
|
||||
Assert(stream != null);
|
||||
cstring_clear(&stream->name);
|
||||
cstring_push_cstr(&stream->name, file_name, strlen(file_name));
|
||||
@@ -78,7 +78,7 @@ int main(int argc, char *argv[]) {
|
||||
break;
|
||||
}
|
||||
LOG_DEBUG("token `%s` at %s:%u:%u", get_tok_name(tok.type),
|
||||
tok.loc.name, tok.loc.line, tok.loc.col);
|
||||
cstring_as_cstr(&tok.loc.name), tok.loc.line, tok.loc.col);
|
||||
Assert(tok.loc.offset <= fsize);
|
||||
// LOG_DEBUG("%s", tok.val.str);
|
||||
// printf("line: %d, column: %d, type: %3d, typename: %s\n",
|
||||
|
||||
Reference in New Issue
Block a user