feat 重构stream流API并适配lex_parse和lexer
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
void check_skip_line(const char *str, const char *expect_remaining) {
|
||||
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);
|
||||
|
||||
lex_parse_skip_line(stream, &pos);
|
||||
|
||||
@@ -15,7 +15,8 @@ void check_skip_line(const char *str, const char *expect_remaining) {
|
||||
char buffer[256] = {0};
|
||||
int i = 0;
|
||||
int ch;
|
||||
while ((ch = core_stream_next_char(stream)) != core_stream_eof && i < 255) {
|
||||
while ((ch = core_probe_stream_consume(stream)) != core_stream_eof &&
|
||||
i < 255) {
|
||||
buffer[i++] = (char)ch;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user