Step a table's routes past its selector, and panic on an arm with no bound head

This commit is contained in:
2026-09-30 19:57:29 +02:00
committed by Lillem4n
parent c29885e31f
commit d279408ba5
3 changed files with 8 additions and 6 deletions
+5 -3
View File
@@ -113,10 +113,12 @@ func compileArms(t *template) {
}
func compileArm(t *template, a *arm) {
if head := t.head(a.head); head != nil {
w := compilePath(head, a.tail)
a.steps, a.leaves, a.cover = w.steps, w.leaves, w.cover
head := t.head(a.head)
if head == nil {
panic(internalError("{%s} reads a head nothing bound", a.spelling))
}
w := compilePath(head, a.tail)
a.steps, a.leaves, a.cover = w.steps, w.leaves, w.cover
}
// resolveLink binds every reference t reads, refusing one to t's own category, and keys