feat: 添加预处理器宏定义的字符串化和连接操作支持

- 实现了 # 和 ## 预处理器操作符的功能
- 添加了 token 深拷贝和移动函数以支持宏展开
- 修改预处理器展开逻辑以正确处理宏参数替换
- 增加了宏参数分割时对空白字符的处理

fix: 修复预处理器宏展开中的内存管理和逻辑错误

- 修正了宏展开集合的数据结构初始化方式
- 修复了函数式宏调用时括号匹配的判断逻辑
- 改进了宏参数解析过程中空白字符的处理
- 解决了 token 在宏展开过程中的所有权管理问题

chore: 为 justfile 添加文件统计命令并优化构建配置

- 新增 count-file 命令用于统计代码文件数量
- 调整了输出文件的默认命名规则
- 优化了词法分析器 token 释放时的字段重置逻辑
This commit is contained in:
zzy
2026-02-19 11:20:01 +08:00
parent c86071416d
commit 08a60e6e8a
9 changed files with 332 additions and 81 deletions

View File

@@ -11,5 +11,9 @@ count:
# you need download `tokei` it can download by cargo
tokei libs runtime src -e tests
count-file:
# you need download `tokei` it can download by cargo
tokei libs runtime src -e tests --files
build_lexer:
python ./tools/cbuild/cbuild.py --path libs/lexer build