feat(ast): 更新AST字面量表示方式

更新AST定义以使用词素字符串代替常量值,
并修改AST转储功能以正确显示字面量内容。

BREAKING CHANGE: AST表达式结构体中literal成员从value改为lexme字段。

refactor(pproc): 重构宏展开和文件包含逻辑

将宏展开函数重构为独立接口,实现文件包含处理逻辑,
改进预处理器的状态管理机制。

fix(sstream): 修复文件流初始化错误码返回

修正文件打开失败时的错误码返回值,确保调用方能正确处理异常情况。
This commit is contained in:
zzy
2026-02-19 15:56:05 +08:00
parent 27a87d17ab
commit a52ff33e30
9 changed files with 156 additions and 27 deletions

View File

@@ -22,5 +22,12 @@ scc_lexer_array_to_ring(scc_lexer_tok_vec_t *array) {
}
void scc_pproc_expand_macro(scc_pproc_expand_t *expand_ctx);
void scc_pproc_expand_by_src(scc_pproc_macro_table_t *macro_table,
scc_lexer_tok_ring_t *input,
scc_lexer_tok_ring_t *output,
const scc_pproc_macro_t *macro);
void scc_pproc_expand_by_vec(scc_pproc_macro_table_t *macro_table,
scc_lexer_tok_vec_t *input,
scc_lexer_tok_ring_t *output);
#endif /* __SCC_PPROC_EXPAND_H__ */