From 8ca887aa7d6e75a9aafddb9a793a1272306d4e05 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 15 Sep 2026 14:39:25 +0200 Subject: [PATCH] Name digits among an operand's spellings, and document number by what its text is --- template.go | 2 +- value.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/template.go b/template.go index 0b9e76b..1e5d3e6 100644 --- a/template.go +++ b/template.go @@ -73,7 +73,7 @@ type builtin struct { // for a builtin that reads none. operands func(args []string) []string // number bounds the number a call prints and names the datatype its text is; nil - // for a builtin that prints text. + // for a builtin whose text is no number. number func(args []string) (proven, DataType) } diff --git a/value.go b/value.go index 56c3d93..5d580b5 100644 --- a/value.go +++ b/value.go @@ -92,7 +92,9 @@ func (p *valueProof) template(t *template) proven { case t.fixed: return literalValue(t.lit) case len(t.ops) != 1: - return unproven(fmt.Sprintf("%q is not one value; write one literal or one {int()}, {float()}, {seq()} or {calc()}, or read one", t.format)) + v := unproven(notOneValue(t.format, "{int()}, {float()}, {seq()} or {calc()}")) + v.notNumber = notOneValue(t.format, "{int()}, {float()}, {seq()}, {digits()} or {calc()}") + return v } body := t.format[1 : len(t.format)-1] name, args, isFunc := funcCall(body) @@ -227,6 +229,10 @@ func printing(token string, prints DataType, v proven) proven { return v } +func notOneValue(format, calls string) string { + return fmt.Sprintf("%q is not one value; write one literal or one %s, or read one", format, calls) +} + // unproven is a render no datatype and no calc can take, for why. func unproven(why string) proven { v := proven{notNumber: why}