diff --git a/format.go b/format.go index 369917d..3a93418 100644 --- a/format.go +++ b/format.go @@ -434,6 +434,16 @@ func (c *formatOps) field(tok formatToken, refs map[string]refBinding) { c.ops = append(c.ops, op{formatToken: tok, arms: arms}) } +// compileFormat compiles a format into ops, and applies the fences that need the +// compiled reads. +func compileFormat(toks []formatToken, refs map[string]refBinding) (formatOps, error) { + c := compileOps(toks, refs) + if err := checkNoOverlap(c); err != nil { + return c, err + } + return c, checkNoRepeatedRead(c) +} + // compileOps compiles a parsed format. Call checkTokens first: it is what proves // every token valid. func compileOps(toks []formatToken, refs map[string]refBinding) formatOps { diff --git a/node.go b/node.go index ccf9262..bf158b9 100644 --- a/node.go +++ b/node.go @@ -227,16 +227,6 @@ func (t *template) fixedText() (string, bool) { return "", false } -// compileFormat compiles a format into ops, and applies the fences that need the -// compiled reads. -func compileFormat(toks []formatToken, refs map[string]refBinding) (formatOps, error) { - c := compileOps(toks, refs) - if err := checkNoOverlap(c); err != nil { - return c, err - } - return c, checkNoRepeatedRead(c) -} - func compileChoice(items []any, pos position) (node, error) { itemPos := inFormat if pos == inColumn { diff --git a/todo.md b/todo.md index 29aff58..a02fb17 100644 --- a/todo.md +++ b/todo.md @@ -34,9 +34,6 @@ ranking `readSurvey.walk` and `edge` hardest and the unit they would least modif This round, in order: -- Compile a format in `format.go`: `linkTemplate` calls `compileFormat` in `node.go`, - which calls `compileOps` and `holdfence.go`'s two checks, and both architects placed - the step wrong. - Delete the "so which … is reported does not vary" clause at its five sites past `checkNodeFences`, and `checkRecordDraws`' "A record-only template's format renders nothing", which runs over templates with a format too.