refactor(lexer): 移除未使用的期望函数并修复内存分配错误
移除了 scc_lexer_tok_expect 函数,因为它不再被使用。 在 lexer_stream_extend 函数中添加了返回语句,以在内存重新分配失败时正确处理错误。 BREAKING CHANGE: 移除了 scc_lexer_tok_expect 函数
This commit is contained in:
@@ -14,6 +14,7 @@ static void lexer_stream_extend(scc_lexer_stream_t *stream, usize n) {
|
||||
scc_realloc(null, new_cap * sizeof(scc_lexer_tok_t));
|
||||
if (!new_data) {
|
||||
LOG_FATAL("lexer_stream_extend: realloc failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// 将旧缓冲区中的数据拷贝到新缓冲区,保持顺序
|
||||
|
||||
Reference in New Issue
Block a user