Files
l-language/CHANGELOG.md
T
Serendipity 3b7bab1e1b feat: L Language v0.1 编译器完整实现
5 阶段编译流水线: 词法分析 → 语法分析(Pratt) → 语义分析(类型推断) → LLVM IR → .exe

模块:
- lexer: 手写状态机, 40 种 Token, // 和 /* */ 注释
- parser: Pratt 表达式解析(9 级优先级) + 递归下降语句/函数
- ast: 14 种节点类型 + 工厂函数
- sema: 作用域链符号表 + 类型推断 + 类型检查
- codegen: AST → LLVM-C API, print_i64/f64/bool 内建
- driver: 命令行 + 流水线串联 + 错误报告
- util: Arena bump allocator (8MB)

测试: 65 单元测试(词法41+语法15+语义9) + 5 集成测试 全部通过

语言特性: i64/f64/bool/void, let不可变变量, if/else, while, 递归函数
2026-06-05 00:26:59 +08:00

20 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Changelog
## 0.1.0 (2026-06-05)
### Added
- 词法分析器:手写状态机,40 种 Token 类型,支持 `//``/* */` 注释
- 语法分析器:Pratt 表达式解析(9 级优先级)+ 递归下降语句/函数解析
- AST:14 种节点类型,工厂函数模式创建
- 语义分析器:作用域链符号表 + 类型推断 + 类型检查
- LLVM IR 代码生成:全 AST 节点覆盖,内建 `print_i64` / `print_f64` / `print_bool`
- 驱动程序:命令行参数解析 + 编译流水线串联 + `--emit-ir` 调试模式
- Arena bump allocator (8MB)
- 错误报告:ANSI 红色高亮,文件名:行号:列号 格式
- 类型系统:`i64` / `f64` / `bool` / `void``let` 不可变变量,类型推断
- 控制流:`if` / `else``while` 循环,`return` 语句
- 函数:多参数、递归、可选返回类型标注
- 65 个单元测试 (词法 41 + 语法 15 + 语义 9)
- 5 个集成测试 (算术、分支、递归、斐波那契、浮点)
- CMake 构建系统,静态库 + 可执行文件 + 测试分离