|
|
86c6e276be
|
feat: 适配 Lua 5.0.3 (lua_5.0 分支)
- 桥接层编译通过, 核心功能可用(init/load/unload/callfunction/dostring)
- 新增 compat_50.h 兼容层集中处理 5.0 差异:
* luaL_newstate → lua_open (#define)
* lua_status → 恒 LUA_OK(5.0 单线程, 无状态查询)
* luaL_dostring → lua_dostring(lauxlib)
* lua_getfield/setfield → pushstring+gettable/settable
(含绝对索引修正, 避免 push 后相对偏移)
* lua_Integer → double, lua_pushinteger→pushnumber(5.0 无整数类型)
* luaL_Reg typedef(5.0 结构体名小写 luaL_reg)
* open_std_libs 替代 luaL_openlibs(5.0 需逐库 luaopen_*)
- 5.0 无 package 系统: pkgpath 构造函数参数被忽略; clean 跳过
package.loaded={} 操作
- 5.0 不支持 ... 表达式(chunk 级无变参): 涉及此语法的测试脚本
需替换为 5.0 兼容版(已创建 test/scripts50/ 目录)
- 验证: lib 构建 0 error, InitFree 通过; 因语法差异部分测试未全过
(桥接层本身无 bug, 属测试脚本版本差异)
|
2026-08-25 12:59:17 +08:00 |
|
|
|
237aab3f36
|
feat: typed interop 原始类型直通映射 (Int64/Float64/Bool)
- C++ 层: callfunction_int/num/bool/void + run_int/num/bool/void
- 新增 capture_result()/finish_call() 正确计算 lua_pcall 实际返回值数量,
修复无返回值场景下误读栈残留的问题
- C FFI 层: 11 个新导出函数 + lua_runner 结构体 tresult_* 镜像字段
- 仓颉层: callFunctionInt/Num/Bool, runScriptInt/Num/Bool, resultType()
带严格类型校验(不匹配抛 LUAERR_RESULT_TYPE)
- 大整数跨 2^53 保真(字符串路径做不到)
- 管道模式语义保留给字符串 API; typed run_* 为独立调用保持栈清洁
- GTest 新增 10 个 typed 测试用例(共 44 个全部通过)
- 独立程序验证仓颉层运行时正确性(int/num/bool直通/大整数保真/错误路径)
|
2026-08-25 09:29:24 +08:00 |
|