feat 重构stream流API并适配lex_parse和lexer
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
cbool check_char(const char *str, int expect, int *output) {
|
||||
log_set_level(&__default_logger_root, 0);
|
||||
core_pos_t pos = core_pos_init();
|
||||
core_mem_stream_t mem_stream;
|
||||
core_stream_t *stream =
|
||||
core_mem_stream_init(&mem_stream, str, smcc_strlen(str), false);
|
||||
core_mem_probe_stream_t mem_stream;
|
||||
core_probe_stream_t *stream =
|
||||
core_mem_probe_stream_init(&mem_stream, str, smcc_strlen(str), false);
|
||||
*output = lex_parse_char(stream, &pos);
|
||||
return *output == expect;
|
||||
}
|
||||
@@ -57,4 +57,4 @@ TEST_LIST = {
|
||||
{"test_escape_char", test_escape_char},
|
||||
{"test_invalid_char", test_invalid_char},
|
||||
{NULL, NULL},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user