refactor(pproc): 重构预处理器条件编译逻辑

- 提取条件判断逻辑到独立函数 scc_pproc_parse_if_need_skip
- 使用辅助函数 in_if, in_elif, in_else, in_endif 简化条件处理
- 添加宏 __SCC_PPROC_LOG_PNT 统一错误和警告处理逻辑
- 增加嵌套条件测试用例验证非活动状态下的正确行为
This commit is contained in:
zzy
2026-02-27 17:06:04 +08:00
parent 4e2176b7f0
commit 72ef3964ce
4 changed files with 152 additions and 110 deletions

View File

@@ -68,6 +68,7 @@ static inline void scc_pproc_add_include_path_cstr(scc_pproc_t *pp,
void scc_pproc_handle_directive(scc_pproc_t *pp);
cbool scc_pproc_parse_if_need_skip(scc_pproc_t *pp, scc_tok_type_t type);
cbool scc_pproc_parse_if_defined(scc_pproc_t *pp, scc_tok_type_t type,
const scc_lexer_tok_t *tok);
cbool scc_pproc_parse_if_condition(scc_pproc_t *pp, scc_tok_type_t type,