Read a bare number or boolean template as a format string, in the padded-JSON decision

This commit is contained in:
2026-10-08 12:18:46 +02:00
committed by Lillem4n
parent 68c4313b7a
commit 8b5ed36bca
+4 -2
View File
@@ -117,8 +117,10 @@ until item 129: it reads a path, and only the data is absent.
2026-10-07, Lilleman auf Larv. Applies KISS.
Padding is where the two readings disagree: a format string renders it, JSON drops it. A
template that parses as JSON is its JSON, so its padding is dropped, as `encoding/json`
drops it. Goal 5.7 loads it: it is well-formed and means one thing.
template that parses as a JSON object, array, string or `null` is its JSON, so its padding
is dropped, as `encoding/json` drops it. A bare number or boolean gains nothing from the
JSON reading, so it is a format string, and `echo 42` prints its newline as `echo x` does
(goal 5.1).
## A JSON string stays a template even where its bare text renders alike