aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Court`es2006-06-06 09:08:09 +0000
committerLudovic Court`es2006-06-06 09:08:09 +0000
commit1fcd75bfb36d9b58bd08b0cf947457f38a9cb4c8 (patch)
treee5f1040da34ff2d8de234b7ba06f86ad1b236dd1
parentae5fa7ed8c2376416e217cfd86ac75238f338b0b (diff)
downloadskribilo-1fcd75bfb36d9b58bd08b0cf947457f38a9cb4c8.tar.gz
skribilo-1fcd75bfb36d9b58bd08b0cf947457f38a9cb4c8.tar.lz
skribilo-1fcd75bfb36d9b58bd08b0cf947457f38a9cb4c8.zip
Cleaned up the `write' method for `markup' and `unresolved' objects.
* src/guile/skribilo/ast.scm (write): New method. git-archimport-id: lcourtes@laas.fr--2004-libre/skribilo--devel--1.2--patch-85
-rw-r--r--src/guile/skribilo/ast.scm25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/guile/skribilo/ast.scm b/src/guile/skribilo/ast.scm
index f335dbd..86c6b5c 100644
--- a/src/guile/skribilo/ast.scm
+++ b/src/guile/skribilo/ast.scm
@@ -273,12 +273,31 @@
(hash-ref *node-table* ident #f))
-(define-method (write-object (obj <markup>) port)
- (format port "#[~A (~A/~A) ~A]"
+(define-method (write (obj <markup>) port)
+ (format port "#<~A (~A/~A) ~A>"
(class-name (class-of obj))
(slot-ref obj 'markup)
(slot-ref obj 'ident)
- (address-of obj)))
+ (object-address obj)))
+
+(define-method (write (node <unresolved>) port)
+ (let ((proc (slot-ref node 'proc)))
+ (format port "#<<unresolved> (~A~A) ~A>"
+ proc
+ (let* ((name (or (procedure-name proc) ""))
+ (source (procedure-source proc))
+ (file (and source (source-property source 'filename)))
+ (line (and source (source-property source 'line))))
+ (format (current-error-port) "src=~a~%" source)
+ (string-append name
+ (if file
+ (string-append " " file
+ (if line
+ (number->string line)
+ ""))
+ "")))
+ (object-address node))))
+
;;; XXX: This was already commented out in the original Skribe source.