refactor(lexer): 重构词法分析器头文件结构并优化缓冲区管理

移除了旧的lexer_stream.c实现,引入新的环形缓冲区机制来替代原有的
动态数组缓冲区。更新了词法分析器的核心数据结构,修改了token获取
相关函数的实现以支持新的缓冲区管理方式。

BREAKING CHANGE: 移除了scc_lexer_stream_t相关的API,替换为基于
环形缓冲区的新接口scc_lexer_to_ring和相关函数。

feat(lexer_token): 添加词法分析结果内存泄漏警告注释

docs: 移除预处理器模块的测试文件和相关配置
This commit is contained in:
zzy
2026-02-16 21:21:23 +08:00
parent 0e7dec202a
commit b4929be6b8
72 changed files with 119 additions and 2474 deletions

View File

@@ -1,5 +1,5 @@
#include <lexer.h>
#include <lexer_log.h>
#include <scc_lexer.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -53,10 +53,7 @@ int main(int argc, char *argv[]) {
scc_get_tok_name(token.type),
scc_cstring_as_cstr(&token.lexeme), token.loc.name,
token.loc.line, token.loc.col);
// LOG_DEBUG("%s", token.val.str);
// printf("line: %d, column: %d, type: %3d, typename: %s\n",
// lexer.line, lexer.index, token.type,
// scc_get_tok_name(token.type));
scc_cstring_free(&token.lexeme);
}
scc_sstream_drop_ring(ref);
scc_sstream_drop(&stream);