diff --git a/node.go b/node.go index e488658..5f6f754 100644 --- a/node.go +++ b/node.go @@ -11,8 +11,8 @@ import ( // node is a compiled element of the namespace tree: a folder, choice, null, // template, table, column or row. Compiling JSON into these once (see compile) -// means rendering never re-inspects the raw JSON or re-sums weights. A new kind goes in -// every switch that panics through internalError on a kind it does not list. +// means rendering never re-inspects the raw JSON or re-sums weights. A new kind needs a +// case in contained, paths, render and renderEdges; each panics on a kind it does not list. type node interface{ isNode() } // folder is a namespace of named children, built from a directory of JSON files diff --git a/render.go b/render.go index e8cf1c9..0ac5970 100644 --- a/render.go +++ b/render.go @@ -49,7 +49,7 @@ func descend(s *session, root node, segments []string, sc renderScope) (node, er // render evaluates a compiled node to a string. compile validates every node up // front, so rendering a compiled tree cannot fail. sc holds the reference draws the // render shares; each repeat iteration renders over a hold set of its own. -// renderEdges mirrors this switch for the fences. +// A child this switch renders is one renderEdges must list too, or the fences miss it. func render(s *session, n node, sc renderScope) string { switch n := n.(type) { case *choice: