Answer architecture round 1: one invariant phrase in internal/invariant, held across every package, Source built by Dir and FS, coverage counted across packages, and file items 112 and 113

This commit is contained in:
2026-10-05 15:44:38 +02:00
committed by Lillem4n
parent 835cdb57d4
commit dd2fe61b13
26 changed files with 144 additions and 95 deletions
+3 -2
View File
@@ -8,6 +8,7 @@ import (
"github.com/larvit/fejkdata/internal/drawstate"
"github.com/larvit/fejkdata/internal/grammar"
"github.com/larvit/fejkdata/internal/invariant"
"github.com/larvit/fejkdata/internal/proven"
)
@@ -28,7 +29,7 @@ func evalCalc(n grammar.CalcNode, operands []string) float64 {
case grammar.CalcBin:
return Arith(n.Operator, evalCalc(n.L, operands), evalCalc(n.R, operands))
}
panic(internalError("calc node %#v has no evaluation", n))
panic(invariant.Broken("calc node %#v has no evaluation", n))
}
// Arith applies a calc operator.
@@ -80,7 +81,7 @@ func calcPrep(args []string) Call {
func ParsedCalc(expr string) grammar.Calc {
c, err := grammar.ParseCalc(expr)
if err != nil {
panic(internalError("calc(%q) passed its check unparsed: %v", expr, err))
panic(invariant.Broken("calc(%q) passed its check unparsed: %v", expr, err))
}
return c
}