Repository navigation
fix(cl): nodeInterp.LoadExpr - #1114
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1114 +/- ##
==========================================
+ Coverage 86.29% 91.09% +4.79%
==========================================
Files 26 26
Lines 3459 3480 +21
==========================================
+ Hits 2985 3170 +185
+ Misses 474 310 -164
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
This is a focused, well-scoped change: it implements the previously-stubbed nodeInterp.LoadExpr, seeds the INT_MAX built-in macro (c_INT_MAX), threads source-position nodes through the auto-macro-func codegen, and adds debugMacroFunc logging. cl/... builds cleanly.
Verified correct: c_INT_MAX = (1 << (unsafe.Sizeof(c.Int(0))*8 - 1)) - 1 evaluates to 2147483647 (c.Int is a fixed int32 in goplus/lib), a platform-independent untyped constant that boxes into any as int. The testdata lines up: LUA_REGISTRYINDEX = -(INT_MAX/2 + 1000) = -1073742823, matching cl/_testc/lua/out.go, and lua_getfield -> Getfield is consistent with in.h. The pointer->value nodeInterp receiver and the removal of the unused fset field are behavior-preserving (the impl now reaches the fileset via v.ctx). The macrofunc.go node threading is sound (all builder methods take src ...ast.Node; goNode returns a true nil, so there is no typed-nil pitfall).
Worth addressing before merge: LoadExpr now runs for real (previously it was a panic("todo") stub), and both its failure modes are fatal because the auto-macro-func codegen runs in a post-unit with no recover (gogen's default HandleErr panics). See the inline comment on LoadExpr. The other items are minor (memory retention, naming, stale TODO).
No description provided.