feat(parser): 使用静态数组初始化测试向量

- 将多个测试用例中的 `scc_vec_unsafe_from_array` 替换为
  `scc_vec_unsafe_from_static_array` 以提高性能
- 此更改影响了 `test_parser_unit` 和 `test_parser_type` 函数中的多个位置

feat(sccf): 添加SCC格式支持和相关工具

- 创建新的 sccf 库用于处理 SCCF (SCC Format) 文件格式
- 实现了基本的文件格式定义,包括头部、段表、符号表等结构
- 添加了构建器和链接器的基本框架
- 包含格式化工具的初始实现

refactor(main): 修复输出文件检查逻辑

- 修正主函数中输出文件检查条件,确保在 fp 为 null 时正确处理
- 更新输出消息显示逻辑以匹配文件操作状态
This commit is contained in:
zzy
2026-03-16 11:02:32 +08:00
parent 45c59e0b65
commit cabd1710ed
12 changed files with 614 additions and 27 deletions

View File

@@ -288,7 +288,7 @@ int main(int argc, const char **argv, const char **envp) {
if (config.emit_pp) {
scc_lexer_tok_ring_t *tok_ring =
scc_pproc_to_ring(&pproc, 8, true, true);
if (config.output_file == null) {
if (fp == null) {
print_ring(tok_ring, config.verbose);
} else {
print_file(tok_ring, fp);
@@ -356,6 +356,11 @@ sstream_drop:
return 0;
}
scc_printf("output exe at %s\n", config.output_file);
if (fp == null) {
scc_printf("output exe at %s\n", config.output_file);
} else {
scc_printf("output exe at %s\n", config.output_file);
}
return 0;
}