controllogic: locals as Value, init from declarations, value-aware write

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Martino Ferrari
2026-06-24 19:40:29 +02:00
parent 519c1f2df4
commit a6fa4e7c7c
4 changed files with 114 additions and 19 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ import (
)
func TestEvalExpr(t *testing.T) {
resolve := func(ds, name string) Value { // shim: was float64 (Task 4 removes)
resolve := func(ds, name string) Value {
switch {
case ds == "stub" && name == "x":
return 10
@@ -46,7 +46,7 @@ func TestEvalExpr(t *testing.T) {
}
func TestEvalExprErrors(t *testing.T) {
r := func(ds, name string) Value { return 0 } // shim: was float64 (Task 4 removes)
r := func(ds, name string) Value { return 0 }
for _, bad := range []string{"1 +", "(1", "1 2", "{unterminated"} {
if v := EvalExpr(bad, r); !math.IsNaN(v) {
t.Errorf("EvalExpr(%q) = %v, want NaN", bad, v)