Commit Graph
24 Commits
Author SHA1 Message Date
TermiNexus 915054495f fix(ast): 补齐 exprs 字段访问辅助函数 re-export
5cda173 只补了 attribute_get_attr,TypeGen 还以 ast.<helper> 调用
attribute_get_value/name_get_id/constant_get_str_val/binop_get_left/
binop_get_right(均定义在 ast.exprs)→ 同样触发跨模块返回类型解析
fail-fast。一次性全部补入 from .exprs import 导出列表。
2026-08-19 05:26:26 +08:00
TermiNexus 5cda173a5e fix(ast): re-export attribute_get_attr 修复跨模块返回类型解析失败
TPV TypeGenCType/TypeGenResolve 以 ast.attribute_get_attr(at) 调用,但 ast
包 from .exprs import (...) 未 re-export 该函数(定义在 ast.exprs)→ 跨模块
函数返回类型解析在 ast 包 text.ll 找不到定义 → fail-fast "返回类型无法
精确获取"。按既有 re-export 惯例(如 get_parse_err_line)补入导出列表。
2026-08-19 05:18:41 +08:00
TermiNexus a2378e6878 chore(ast): Attribute.__init__ 加构造断点,定位 stdint.vp attr 垃圾来源 2026-08-18 09:25:36 +08:00
TermiNexus 802377e9ab feat(ast): 加 Name/Attribute/Constant/BinOp 字段访问器,绕开跨模块 stub 字段访问陷阱 2026-08-18 08:59:10 +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 451e7a0391 fix(ast/parser): extern 无 body 形式消费本行 NewLine,修复 Phase1a-pre 7 文件扫描失败
extern def A(...) -> T(无 ': pass')解析完返回时 cur 停在 NewLine token,
模块级/类体语句循环只 _skip_nl(Nl)不跳 NewLine,下一轮把 NewLine 当
表达式解析(_parse_atom error_count++)→ parse_tokens 返回 None →
Phase1a-pre 报 7 个文件扫描失败(w32 7 个 extern 文件全挂的根因)。
2026-08-17 11:57:01 +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 a7bbd68507 fix(parser/lexer): 支持括号内行首 or/and、类基类跨行、CRLF 反斜杠续行(追加69/70/71) 2026-08-16 11:19:16 +08:00
TermiNexus 0e93f40289 fix(includes): 导出 llvmlite 缺失符号 + 移除临时 DBG
- llvmlite.__init__ 导出 get_struct_fields/get_struct_fcount/DeepCopyType(HandlesAssign tuple 解包与 ClassGenMixin 深拷贝调用 fast-fail 符号未定义)
- 移除 string.vp [ATOF-DBG]、ast/parser.vp [LKP-DBG] 临时插桩(保留查表逻辑)
2026-08-12 21:13:36 +08:00
TermiNexus b4567ffb9a fix(llvmlite): opaque与空结构体区分(fcount哨兵);ast表达式节点调整 2026-08-12 01:27:24 +08:00
TermiNexus 2120a0a4ab feat(ast): 结构化 Stmt/Expr 中间基类(isinstance 分类支持)
- base.vp 新增 Stmt/Expr(CVTable,继承 AST),__init__.vp 导出
- stmts.vp 23 个语句类继承 Stmt,exprs.vp 27 个表达式类继承 Expr
- 顶层/辅助/模式/OpNode 保持 AST 直继承(非 Stmt 非 Expr)
2026-08-10 21:48:41 +08:00
TermiNexus a6444a4e1f feat(includes): 软关键字 fn/fun/func/function 与 match 语句判定; 解析 fail-fast 错误记录(get_parse_err_*) + 相邻字符串字面量隐式拼接; ord/chr 内置函数; llvmlite build_alloca_aligned; memhub 超块请求返回 NULL; numpy 显式 string./stdio. 前缀; this 数组迭代修复 2026-08-09 17:10:34 +08:00
TermiNexus 61e578fe9a fix(includes): atof_out 输出参数版绕开跨模块 double 返回 bug; 浮点节点构造值记录+查询(parser); NEWF/ATOF/LKP 定位插桩; ast 导出查表函数 2026-08-08 19:42:55 +08:00
TermiNexus efb4aada15 chore(includes): 添加浮点字面量解析定位插桩 - string.atof 打印长字面量解析中间值(ATOF-DBG); parser._new_const_float 打印构造值/readback/节点覆写监控(NEWF-DBG/OVW-DBG); 用于定位浮点 CDefine 值错误(llc ret i32 0) 2026-08-08 18:18:52 +08:00
TermiNexus 44ff0d551f fix(ast): 解析 PEP695 泛型函数类型参数 [T],修复函数体被误提升模块级
- _parse_funcdef 消费并存储 def f[T](...) 的类型参数(与 class 解析器一致)

- FunctionDef 增加 type_params 字段(默认 None,非泛型函数不受影响)

- 修复: 之前 [T] 未消费导致 _expect_op(Colon) 失败、函数体被误提升到模块级,b = Box(42) 被注册为模块级全局,函数内赋值误报需用 global 声明
2026-08-08 11:54:43 +08:00
TermiNexus c5570dc8b1 将 ast 英化 2026-08-07 18:49:53 +08:00
TermiNexus 2071486168 相对稳定版本 2026-08-06 18:04:12 +08:00
TermiNexus a39b5da0f8 基本稳定 2026-08-05 20:11:38 +08:00
TermiNexus cfc30d735c 将 .py 和 .pyi 后缀名改为了 .vp 和 .vpi 后缀名 2026-07-30 16:33:56 +08:00
TermiNexus f79c8ca643 Fixed 2026-07-30 13:34:26 +08:00
TermiNexus a2cc28a6ab Rewrote the comments in the libraries under 'includes' in English (excluding those inside folders) 2026-07-29 23:34:36 +08:00
TermiNexus 3633be1995 Some simple information syncing 2026-07-28 21:08:58 +08:00
TermiNexus 1837339f69 修正了一些错误 2026-07-26 20:32:26 +08:00
t 796222a300 snapshot before regression test 2026-07-18 19:25:40 +08:00