Refuse a name read across draw groups or in a repeat where it reads a reference path, or read once; name the spelling in each refusal

This commit is contained in:
2026-10-03 12:08:40 +02:00
committed by Lillem4n
parent 05cf531339
commit 740f2bc3bd
6 changed files with 138 additions and 47 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ func TestNameErrors(t *testing.T) {
`no field "w"; name "w" is bound inside the repeat at field "x"`},
{"padded", map[string]string{"word": `["a","b"]`, "card": `"{/word as w}{w}"`},
`write {/word as w}`},
{"selector after a name", map[string]string{"region.json": nameTables()["region.json"], "region.tsv": nameTables()["region.tsv"], "municipality.json": nameTables()["municipality.json"], "municipality.tsv": nameTables()["municipality.tsv"], "card": `"{/region as r}{r.municipality[0180].name}"`},
{"selector after a name", map[string]string{"region.json": nameTables()["region.json"], "region.tsv": nameTables()["region.tsv"], "municipality.json": nameTables()["municipality.json"], "municipality.tsv": nameTables()["municipality.tsv"], "card": `"{/region as r}{r.name} {r.municipality[0180].name}"`},
`read it directly, {/region.municipality[0180].name}`},
{"in a table's format", map[string]string{"word": `["a","b"]`, "t.json": `{"format":"{/word as w}{w}","rows":"t.tsv","key":"k"}`, "t.tsv": "k\nx\ny\n"},
"a table binds no name"},