Serendipity
|
b390d390f3
|
feat: 结构体 struct — 最后一项 P0 功能
- lexer: TOK_STRUCT, TOK_DOT 关键字和运算符
- ast: AST_STRUCT_DECL/STRUCT_INIT/FIELD_ACCESS 3 种新节点
- parser: struct 声明 + .field 访问 + Name{field:val} 初始化
- sema: struct 类型符号表,字段类型解析,初始化字段检查
- codegen: LLVMStructType + extractvalue/insertvalue 字段操作
- 新增集成测试: 12_struct.l, 13_struct_nested.l
- 基于 Codex 分析报告 P0 #4
所有 P0 功能已全部完成。
|
2026-06-05 12:21:22 +08:00 |
|
Serendipity
|
382cd089d0
|
test: sema + codegen 测试补全 — 86 单元测试
- test_sema: +4 测试 (let_mut_assign_ok, assign_immutable_error, str_type_ok, str_concat_ok) → 21 tests
- test_codegen: +1 测试 (while_loop LLVMVerifyModule) → 9 tests
- 总单元测试: 86 (词法41+语法15+语义21+代码生成9)
- 基于 Codex 分析报告 §5-3 §5-4 技术债务补偿
|
2026-06-05 06:34:45 +08:00 |
|
Serendipity
|
72a971e5bf
|
test: 新增 codegen 层单元测试 (7 tests)
- test_codegen.c: 构造 AST → codegen_module → LLVMVerifyModule
- 覆盖: 函数+返回字面量, if/else 分支, 二元运算(1+2*3)
- 总单元测试: 41+15+9+7 = 72
- 基于 Codex 分析报告 §5-4 技术债务补偿
|
2026-06-05 02:40:58 +08:00 |
|