controllogic: debug value is Value (array-capable); lua get narrows to scalar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Martino Ferrari
2026-06-24 19:50:47 +02:00
parent 088063d9cd
commit 9c1f2685a7
6 changed files with 28 additions and 23 deletions
+4 -3
View File
@@ -1,6 +1,7 @@
package controllogic
import (
"math"
"sync"
lua "github.com/yuin/gopher-lua"
@@ -60,9 +61,9 @@ func (lr *luaRuntime) ensure() error {
L.SetGlobal("get", L.NewFunction(func(s *lua.LState) int {
target := s.CheckString(1)
ds, name, ok := parseRef(target)
var v float64
if ok && lr.curResolve != nil { // shim: Task 6 finalizes lua Value handling
if f, fok := lr.curResolve(ds, name).(float64); fok {
v := math.NaN()
if ok && lr.curResolve != nil {
if f, isNum := lr.curResolve(ds, name).(float64); isNum {
v = f
}
}