Commit Graph

11 Commits

Author SHA1 Message Date
90448006ff refactor: 引入 Arena 内存池并优化指令分发,为类型系统重构做准备 2026-03-08 15:59:55 +08:00
1fe9ccf7ea feat: 实现控制流语句并优化类型解析
- 新增了 ReturnStmt、BreakStmt 和 ContinueStmt 结构,以支持 AST 中的控制流。
- 引入了 TypeInfo 和 TypeContext 以实现更好的类型管理和解析。
- 对分析器进行了增强,能够处理函数定义和返回语句,包括类型检查和错误处理。
- 更新了编译器和解析器以适应新的控制流语句和类型解析逻辑。
- 重构了现有代码以提高清晰度和可维护性,包括对表达式和语句中的类型处理的更改。
- 删除了过时的 String 和 Struct 定义,代之以 StringObject 和 StructObject 以实现更好的对象表示。
2026-02-28 20:42:15 +08:00
bb23ddf9fa feat: 添加函数定义和类型表达式支持,重构解析器以处理新语法(函数定义) 2026-02-26 14:41:41 +08:00
a0fb8cdffb feat: 添加“while 语句”支持,并对解析器进行重构以处理控制流相关内容
- 引入了 WhileStmt 结构来表示 while 循环语句。
- 在解析器中实现了对 while 语句的解析逻辑。
- 在分析器中为 while 语句添加了语义分析。
- 重构了现有的解析器方法,以利用 StateProtector 进行状态管理。
- 更新了对各种表达式和语句的错误处理。
- 移除了未使用的终止符管理方法,并简化了表达式解析。
- 将 FigLSPServer.cpp 重命名为 LSPServer.cpp,并调整了构建配置。
- 增强了重复声明和类型错误的错误报告。
- 在多个文件中改进了代码格式和一致性。
2026-02-25 17:31:00 +08:00
852dd27836 feat: 优化表达式解析器,添加终止符重置功能及代码格式调整 2026-02-23 15:03:53 +08:00
eb20993e27 feat: 添加If语句及块语句解析支持 2026-02-20 15:46:33 +08:00
2631f76da1 feat: Implement compiler and virtual machine for Fig language
- Added Compiler class with methods for compiling programs, statements, and expressions.
- Introduced Proto structure to hold compiled bytecode and constants.
- Implemented expression compilation including literals, identifiers, and infix expressions.
- Developed statement compilation for variable declarations and expression statements.
- Created a VM class to execute compiled bytecode with support for arithmetic and comparison operations.
- Added Object and Value classes for handling different data types and memory management.
- Implemented String and Struct objects for enhanced data representation.
- Established a parser for parsing variable declarations and statements.
- Included tests for the VM and object representations.
2026-02-20 14:05:56 +08:00
c81da16dfb 修复EOF飘逸(去除末尾\n)以及其他修复... 2026-02-18 00:16:59 +08:00
663fe39070 添加缺失的 doxy 2026-02-17 14:13:57 +08:00
6b75e028ff 修复右结合绑定力错误 2026-02-17 14:03:48 +08:00
878157c2fc 完成Parser定义以及表达式解析 2026-02-14 23:03:46 +08:00