Refuse a calc over digits(0) or a repeat of 0, name an option's wrong kind as JSON does, type the name scope kinds, and compile only from a jsonvalue.Value

This commit is contained in:
2026-10-08 00:02:07 +02:00
committed by Lillem4n
parent ba2ae41ffe
commit 97e72988b1
13 changed files with 106 additions and 55 deletions
+4 -4
View File
@@ -3,8 +3,8 @@ package fejkdata
import (
"fmt"
"github.com/larvit/fejkdata/internal/datafiles"
"github.com/larvit/fejkdata/internal/grammar"
"github.com/larvit/fejkdata/internal/jsonvalue"
)
// Template is an inline template compiled, referenced and validated against a
@@ -70,10 +70,10 @@ func compileInput(input string) (node, error) {
// inputValue reads an inline template as the value compile takes: the JSON value it holds, the
// whitespace around it dropped, or the input itself as a format string when it is not JSON.
func inputValue(input string) any {
raw, err := datafiles.DecodeJSON([]byte(input))
func inputValue(input string) jsonvalue.Value {
raw, err := jsonvalue.Decode([]byte(input))
if err != nil {
return input
return jsonvalue.String(input)
}
return raw
}