TermiNexus
|
f19d25782f
|
refactor(tpc): 退役 t/c 模块并将定宽类型升级为内建
删除 lib/includes/t.py、c.py,类型模型迁入 lib/core/TypeSystem.py;移除 IsTModule/_T_MODULE_NAMES 等名称判据,语法糖与内部标记统一为裸名;builtins 的 sizet/intN/uintN/fast/least/uchar/short/long 等改为编译器内建短名。
|
2026-10-18 13:00:58 +08:00 |
|
TermiNexus
|
23b47053d9
|
chore: 同步 TransPyV→ViperC 改名、new 表达式支持与定宽字面量/窄化适配
|
2026-10-12 20:59:39 +08:00 |
|
TermiNexus
|
74cfaeb917
|
feat(switch): 新增 switch 语句并禁止 match 内 fallthrough
- vast/Nodes.py:Match 增加 is_switch 字段(含默认值)
- vast/Parser.py:新增 _ParseSwitch(case <常量|枚举变体> / default:,desugar 为 Match(is_switch=True));match / struct / fallthrough 改为硬关键字
- vast/Unparser.py:round-trip 忠实还原 switch 与 default:
- HandlesMatch / HandlesBody:新增 in_switch_case 门控,fallthrough 只允许出现在 switch 的 case 体内
- HandlesFor:补齐嵌套函数的 saved_loop_break/continue_targets 定义(修 NameError),并隔离 in_switch_case
- LLVMCG/BaseGen:新增 in_switch_case 状态
|
2026-10-02 23:15:42 +08:00 |
|
TermiNexus
|
45e78ad107
|
基线重置,修复了一些 bug
|
2026-09-07 14:46:02 +08:00 |
|
TermiNexus
|
0230385891
|
feat(tpc): 新增单目 * / & 运算符(Deref/AddrOf)AST 节点与 LLVM 翻译
|
2026-08-28 07:34:58 +08:00 |
|
TermiNexus
|
5d93692baa
|
feat(vast/ast): 新增 export 软关键字声明 CExport 函数(等价 t.CExport)
允许 4 种语法(配不配 def 都一样):export def A(...) / export A(...),
与 extern 对称。返回注解改写为 <原类型> | t.CExport,复用既有 CExport
路径(符号名裸名、不加模块 SHA1 头);无 body 形式消费本行 NewLine。
TPC 侧 vast:_ParseExportDef + Unparser 还原(Export=True);
TPV 侧 includes/ast:Keyword.Export + FLAG_IS_EXPORT=16(追加末尾)+
_is_funcdef_kw/_parse_funcdef 支持。
|
2026-08-17 12:12:32 +08:00 |
|
TermiNexus
|
ce568e10b7
|
feat(vast/ast): 新增 extern 软关键字声明 FFI 函数(等价 t.State)
TPC 侧 vast:
- extern [def] A(...) [-> T] [: pass] 四种语法解析为 FunctionDef
- 返回注解改写为 <原类型> | t.State,复用 TPC 的 IsState 外部函数路径
- 设 Extern 标记,Unparser 还原 extern 语法(round-trip 一致)
TPV 侧 includes/ast(自举前端):
- Keyword.Extern 枚举与 intern,_is_funcdef_kw 软判定
(extern def / extern Name+'( 或 '[')
- _parse_funcdef 支持无冒号声明、FLAG_IS_EXTERN 标记、
returns 改写为 <原类型> | t.State(vpi 含 State → 定义端裸名 + 不生成函数体)
|
2026-08-17 10:41:44 +08:00 |
|
TermiNexus
|
6fc9e19e24
|
feat(vast): 新增自研 Viper/Python 语法解析器取代标准库 ast
TPC 侧取缔对 Python 标准库 ast 模块的依赖,改用 lib/vast 包:
- Nodes: 与 CPython 3.12 ast 完全同构的 131 个节点类(含抽象基类继承)
- Tokenizer: 词法分析(缩进/字符串/f-string/数字/运算符/软关键字)
- ExprParser: 表达式递归下降解析(优先级/lambda/推导式/f-string/切片)
- Parser: 语句解析(def/class/if/for/try/with/match/import/注解)
- Utils/Unparser: walk/dump/unparse/copy_location/literal_eval 等辅助
- 软关键字 fn/fun/func/function 并入解析器, 废除 ExpandSoftKeywords 预处理
- lib/_bootstrap 将 lib 目录加入 sys.path, import vast as ast 零修改替换
- 52 个文件 import ast 替换为 import vast as ast; 94 文件差分测试 0 失败
|
2026-08-17 09:36:38 +08:00 |
|