NAC_Blockchain/cnnl-compiler
NAC Core Team dfe2a85d69 fix(cnnl): 修复编译器字段名并添加新字段支持,实现 cnnl-service HTTP 服务
修复内容:
1. ast.rs: 恢复原始字段名 ty: Type(而非 type_: TypeAnnotation)
   - 添加 name/version/description 字段到 Clause
   - 添加 description 字段到 Obligation
   - 添加 tests 字段到 Program
   - 添加 Expression::Raw 变体
   - 添加 ObligationFrequency::Display 实现
   - 添加 Literal::Display 实现

2. parser/mod.rs: 完全重写,基于原始版本添加新字段支持
   - 支持 name:/version:/description: 字段解析
   - 支持 test "..." { assert ... } 测试块解析
   - 支持 obligation { description: ... } 字段

3. 修复所有模块的编译错误:
   - codegen/bytecode_generator.rs
   - semantic/type_checker.rs
   - semantic/scope_resolver.rs
   - semantic/obligation_validator.rs
   - verification/constraint_generator.rs

4. 新增 cnnl-service HTTP 服务:
   - POST /api/v1/compile  - 编译 CNNL 源代码
   - POST /api/v1/parse    - 解析 CNNL 源代码(返回 AST)
   - POST /api/v1/validate - 验证 CNNL 语法
   - GET  /api/v1/health   - 健康检查
   - GET  /api/v1/version  - 版本信息
   - 监听端口 8765,已部署为 systemd 服务

测试结果:26/26 通过
关联 Issues: #64 #65
2026-02-28 07:52:27 +08:00
..
examples Initial commit: NAC公链核心模块 - 生产级别代码 2026-02-16 19:19:43 -05:00
src fix(cnnl): 修复编译器字段名并添加新字段支持,实现 cnnl-service HTTP 服务 2026-02-28 07:52:27 +08:00
.gitignore Initial commit: NAC公链核心模块 - 生产级别代码 2026-02-16 19:19:43 -05:00
Cargo.lock Initial commit: NAC公链核心模块 - 生产级别代码 2026-02-16 19:19:43 -05:00
Cargo.toml Initial commit: NAC公链核心模块 - 生产级别代码 2026-02-16 19:19:43 -05:00