summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/guile/skribilo/ast.scm3
-rw-r--r--src/guile/skribilo/resolve.scm5
-rw-r--r--tests/resolve.test11
3 files changed, 18 insertions, 1 deletions
diff --git a/src/guile/skribilo/ast.scm b/src/guile/skribilo/ast.scm
index 86fa781..99ce3cf 100644
--- a/src/guile/skribilo/ast.scm
+++ b/src/guile/skribilo/ast.scm
@@ -510,6 +510,9 @@
(document-bind-node! doc node)
(loop (markup-body node) doc))
+ ((node? node)
+ (loop (node-body node) doc))
+
((pair? node)
(for-each (lambda (n) (loop n doc)) node))
diff --git a/src/guile/skribilo/resolve.scm b/src/guile/skribilo/resolve.scm
index 2073f25..d8efe08 100644
--- a/src/guile/skribilo/resolve.scm
+++ b/src/guile/skribilo/resolve.scm
@@ -206,7 +206,7 @@
;; Bind non-unresolved children of RES now so that unresolved
;; children of RES (if any) can look them up in the next `resolve!'
- ;; run. (XXX: This largely duplicated `document-bind-nodes!'.)
+ ;; run. (XXX: This largely duplicates `document-bind-nodes!'.)
(let loop ((node res)
(doc (ast-document node)))
(if (ast? node)
@@ -224,6 +224,9 @@
(document-bind-node! doc node)
(loop (markup-body node) doc))
+ ((node? node)
+ (loop (node-body node) doc))
+
((pair? node)
(for-each (lambda (n) (loop n doc)) node))
diff --git a/tests/resolve.test b/tests/resolve.test
index 864ac88..18408e8 100644
--- a/tests/resolve.test
+++ b/tests/resolve.test
@@ -192,6 +192,17 @@
(eq? (ast-parent x) sub)
(eq? (ast-document x) sub))))))
+(test-assert "node bindings in processor body"
+ (let* ((doc (document #:title "Doc"
+ (processor #:combinator (lambda (e1 e2) e1)
+ (chapter #:ident "c")))))
+ (resolve! doc %engine '())
+ (let* ((proc (car (markup-body doc)))
+ (ch (car (markup-body proc)))
+ (ch* (document-lookup-node doc "c")))
+ (format (current-error-port) "~A vs ~A~%" ch ch*)
+ (eq? ch ch*))))
+
(test-end "resolve")