Move the seeded randomness and the {seq()} counters into internal/drawstate

This commit is contained in:
2026-10-05 11:43:45 +02:00
committed by Lillem4n
parent 4a680f03b3
commit 2d9c315e75
14 changed files with 107 additions and 76 deletions
+3 -1
View File
@@ -4,6 +4,8 @@ import (
"fmt"
"strings"
"unicode"
"github.com/larvit/fejkdata/internal/drawstate"
)
// transforms are the builtins that rewrite one operand's value; they nest, so
@@ -65,7 +67,7 @@ func transformPrep(outer func(string) string) func([]string) callFn {
if err != nil {
panic(internalError("transform arg %q reached prep unvalidated: %v", a[0], err))
}
return func(_ *generatorState, _ string, operands []string) string {
return func(_ *drawstate.State, _ string, operands []string) string {
v := operands[0]
for i := len(chain) - 1; i >= 0; i-- {
v = chain[i](v)