diff options
author | Ludovic Courtes | 2007-07-26 15:28:37 +0000 |
---|---|---|
committer | Ludovic Courtes | 2007-07-26 15:28:37 +0000 |
commit | 5bee16635e465c11fd695ae04e5248d652abfff0 (patch) | |
tree | c574d942ba45fc1551f65dc4c82539fe2d6a8192 /src/guile | |
parent | 589f5c30734517b51333049a60360467b701dcd7 (diff) | |
download | skribilo-5bee16635e465c11fd695ae04e5248d652abfff0.tar.gz skribilo-5bee16635e465c11fd695ae04e5248d652abfff0.tar.lz skribilo-5bee16635e465c11fd695ae04e5248d652abfff0.zip |
`outline' reader: Fixed `append-trees'.
* src/guile/skribilo/reader/outline.scm (append-trees): Make sure only
symbols can appear as the head of the resulting list.
git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-139
Diffstat (limited to 'src/guile')
-rw-r--r-- | src/guile/skribilo/reader/outline.scm | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/guile/skribilo/reader/outline.scm b/src/guile/skribilo/reader/outline.scm index 7411892..1e64d01 100644 --- a/src/guile/skribilo/reader/outline.scm +++ b/src/guile/skribilo/reader/outline.scm @@ -83,15 +83,21 @@ equal to @var{name}, a markup name." (let loop ((trees trees) (result '())) (if (null? trees) - result + (let ((result (reverse! result))) + (cond ((and (pair? result) + (not (symbol? (car result)))) + ;; Make sure only symbols end up in the head. + (cons 'list result)) + (else + result))) (let ((tree (car trees))) (loop (cdr trees) - (append result - (if (list? tree) - (cond ((null? tree) '()) - ((symbol? (car tree)) (list tree)) - (else tree)) - (list tree)))))))) + (append (if (list? tree) + (cond ((null? tree) '()) + ((symbol? (car tree)) (list tree)) + (else tree)) + (list tree)) + result)))))) (define (null-string? s) (and (string? s) (string=? s ""))) |