From 1fcd75bfb36d9b58bd08b0cf947457f38a9cb4c8 Mon Sep 17 00:00:00 2001 From: Ludovic Court`es Date: Tue, 6 Jun 2006 09:08:09 +0000 Subject: 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 --- src/guile/skribilo/ast.scm | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src') 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 ) port) - (format port "#[~A (~A/~A) ~A]" +(define-method (write (obj ) 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 ) port) + (let ((proc (slot-ref node 'proc))) + (format port "#< (~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. -- cgit v1.2.3