Answer architecture round 2: refuse by default where a builtin's operand can be a reference, test the flag against each operand grammar, drop a duplicate test, rename allNeverNumeric, rewrap Computation, and order item 91 after item 4

This commit is contained in:
2026-10-05 01:10:47 +02:00
committed by Lillem4n
parent 94cf741706
commit 0743a049d7
8 changed files with 30 additions and 20 deletions
+12
View File
@@ -4,6 +4,7 @@ import (
"encoding/base64"
"fmt"
"regexp"
"slices"
"strconv"
"strings"
"testing"
@@ -447,3 +448,14 @@ func TestArgErrorsNameTheSpelling(t *testing.T) {
}
}
}
func TestNoRefOperandsMatchesTheOperandGrammar(t *testing.T) {
for name, b := range builtins {
if b.operands == nil {
continue
}
if takesRef := slices.ContainsFunc(b.operands([]string{"/x"}), isRef); b.noRefOperands == takesRef {
t.Errorf("%s: noRefOperands = %v, but its operands func reads a reference: %v", name, b.noRefOperands, takesRef)
}
}
}