summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtes2007-07-26 15:28:37 +0000
committerLudovic Courtes2007-07-26 15:28:37 +0000
commit5bee16635e465c11fd695ae04e5248d652abfff0 (patch)
treec574d942ba45fc1551f65dc4c82539fe2d6a8192
parent589f5c30734517b51333049a60360467b701dcd7 (diff)
downloadskribilo-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
-rw-r--r--ChangeLog17
-rw-r--r--src/guile/skribilo/reader/outline.scm20
2 files changed, 30 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f77ede..b9891f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,23 @@
# arch-tag: automatic-ChangeLog--skribilo@sv.gnu.org--2006/skribilo--devo--1.2
#
+2007-07-26 15:28:37 GMT Ludovic Courtes <ludo@gnu.org> patch-139
+
+ Summary:
+ `outline' reader: Fixed `append-trees'.
+ Revision:
+ skribilo--devo--1.2--patch-139
+
+ * src/guile/skribilo/reader/outline.scm (append-trees): Make sure only
+ symbols can appear as the head of the resulting list.
+
+ modified files:
+ ChangeLog src/guile/skribilo/reader/outline.scm
+
+ new patches:
+ lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-123
+
+
2007-07-18 06:50:29 GMT Ludovic Courtes <ludovic.courtes@laas.fr> patch-138
Summary:
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 "")))