diff options
author | Ludovic Courtès | 2008-01-28 16:34:18 +0100 |
---|---|---|
committer | Ludovic Courtès | 2008-01-28 16:34:18 +0100 |
commit | 9f5ac23d7200ad03d920fdce0f4ee6b291786e37 (patch) | |
tree | cb123a74e293d3528a97aa8b0ecf2a4cbb117084 | |
parent | fdee97318552980faaf321d7cadbcfae9a012b1f (diff) | |
download | skribilo-9f5ac23d7200ad03d920fdce0f4ee6b291786e37.tar.gz skribilo-9f5ac23d7200ad03d920fdce0f4ee6b291786e37.tar.lz skribilo-9f5ac23d7200ad03d920fdce0f4ee6b291786e37.zip |
Properly handle non-list pairs in `resolve' and `verify'.
* src/guile/skribilo/resolve.scm (do-resolve!<pair>): Return N* if
`pair?'.
* src/guile/skribilo/verify.scm (verify<pair>): Add special treatment if
OBJ is not a list.
-rw-r--r-- | src/guile/skribilo/resolve.scm | 5 | ||||
-rw-r--r-- | src/guile/skribilo/verify.scm | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/guile/skribilo/resolve.scm b/src/guile/skribilo/resolve.scm index efecd8d..fbfcd1a 100644 --- a/src/guile/skribilo/resolve.scm +++ b/src/guile/skribilo/resolve.scm @@ -1,7 +1,7 @@ ;;; resolve.scm -- Skribilo reference resolution. ;;; +;;; Copyright 2005, 2006, 2008 Ludovic Courtès <ludo@gnu.org> ;;; Copyright 2003, 2004 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr> -;;; Copyright 2005, 2006 Ludovic Courtès <ludovic.courtes@laas.fr> ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -100,7 +100,8 @@ (Loop (cdr n*))) ((pair? n*) (set-car! n* (do-resolve! (car n*) engine env)) - (set-cdr! n* (do-resolve! (cdr n*) engine env))) + (set-cdr! n* (do-resolve! (cdr n*) engine env)) + n*) (else (raise (condition (&invalid-argument-error (proc-name "do-resolve!<pair>") diff --git a/src/guile/skribilo/verify.scm b/src/guile/skribilo/verify.scm index 2dc1333..f14138f 100644 --- a/src/guile/skribilo/verify.scm +++ b/src/guile/skribilo/verify.scm @@ -1,7 +1,7 @@ ;;; verify.scm -- Skribe AST verification. ;;; -;;; Copyright 2003-2004 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr> -;;; Copyright 2005, 2007 Ludovic Courtès <ludovic.courtes@laas.fr> +;;; Copyright 2005, 2007, 2008 Ludovic Courtès <ludo@gnu.org> +;;; Copyright 2003, 2004 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr> ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -96,7 +96,11 @@ ;;; PAIR (define-method (verify (obj <pair>) e) - (for-each (lambda (x) (verify x e)) obj) + (if (list? obj) + (for-each (lambda (o) (verify o e)) obj) + (begin + (verify (car obj) e) + (verify (cdr obj) e))) obj) ;;; PROCESSOR |