summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès2008-01-29 18:54:42 +0100
committerLudovic Courtès2008-01-29 18:54:42 +0100
commit7bc9bb1b6eff82ff9166298ada9b9db51fdab874 (patch)
tree69d57f5f20d2bd7c7959bac49c2183bf9b1df37f
parent847c10f714a3a9e93620bb78fa9911cf6c7a1dfb (diff)
downloadskribilo-7bc9bb1b6eff82ff9166298ada9b9db51fdab874.tar.gz
skribilo-7bc9bb1b6eff82ff9166298ada9b9db51fdab874.tar.lz
skribilo-7bc9bb1b6eff82ff9166298ada9b9db51fdab874.zip
Really fix resolution of <unresolved> nodes.
* src/guile/skribilo/resolve.scm (do-resolve!<unresolved>): Assign a valid parent to the AST returned by PROC.
-rw-r--r--src/guile/skribilo/resolve.scm28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/guile/skribilo/resolve.scm b/src/guile/skribilo/resolve.scm
index fbfcd1a..54bf112 100644
--- a/src/guile/skribilo/resolve.scm
+++ b/src/guile/skribilo/resolve.scm
@@ -179,18 +179,20 @@
(define-method (do-resolve! (node <unresolved>) engine env)
(with-debug 5 'do-resolve<unresolved>
(debug-item "node=" node)
- (let ((p (assq 'parent env)))
- (slot-set! node 'parent (and (pair? p) (pair? (cdr p)) (cadr p))))
+ (let* ((p (assq 'parent env))
+ (parent (and (pair? p) (pair? (cdr p)) (cadr p))))
- (let* ((proc (slot-ref node 'proc))
- (res (proc node engine env))
- (loc (ast-loc node)))
- (when (ast? res)
- (ast-loc-set! res loc)
- (slot-set! res 'parent (assq 'parent env)))
- (debug-item "res=" res)
- (*unresolved* #t)
- res)))
+ (slot-set! node 'parent parent)
+
+ (let* ((proc (slot-ref node 'proc))
+ (res (proc node engine env))
+ (loc (ast-loc node)))
+ (when (ast? res)
+ (ast-loc-set! res loc)
+ (slot-set! res 'parent parent))
+ (debug-item "res=" res)
+ (*unresolved* #t)
+ res))))
(define-method (do-resolve! (node <handle>) engine env)
@@ -303,3 +305,7 @@
result
#f)))))
+
+;;; Local Variables:
+;;; coding: latin-1
+;;; End: