diff options
author | Ludovic Court`es | 2006-06-06 09:08:09 +0000 |
---|---|---|
committer | Ludovic Court`es | 2006-06-06 09:08:09 +0000 |
commit | 1fcd75bfb36d9b58bd08b0cf947457f38a9cb4c8 (patch) | |
tree | e5f1040da34ff2d8de234b7ba06f86ad1b236dd1 /src | |
parent | ae5fa7ed8c2376416e217cfd86ac75238f338b0b (diff) | |
download | skribilo-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
Diffstat (limited to 'src')
-rw-r--r-- | src/guile/skribilo/ast.scm | 25 |
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. |