Load a generator with no data, a repeat or count of 0, and a name a choice's item binds for that item's own reads

This commit is contained in:
2026-10-07 23:49:25 +02:00
committed by Lillem4n
parent 1e159fdf3a
commit f036f859d6
8 changed files with 48 additions and 53 deletions
+2 -2
View File
@@ -91,7 +91,7 @@ func constantValue(n grammar.CalcNode, operand func(string) []node) (float64, bo
return 0, false
}
t, ok := nodes[0].(*template)
if !ok || t.repeat > 1 {
if !ok || t.repeat != 1 {
return 0, false
}
lit, fixed := t.fixedText()
@@ -122,7 +122,7 @@ func neverNumeric(n node) (text string, never bool) {
return "", true
case *template:
lit, fixed := n.fixedText()
if !fixed || n.repeat > 1 {
if !fixed || n.repeat != 1 {
return "", false
}
if _, err := strconv.ParseFloat(strings.TrimSpace(lit), 64); err != nil {