aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLudovic Courtes2006-07-13 12:34:16 +0000
committerLudovic Courtes2006-07-13 12:34:16 +0000
commit9a02dfaefa324ac1e5df3adc11003e1b578cfe64 (patch)
tree748fe4e06355aa1b04f15236c6a58207ff473caf /src
parent5c602ddef86c6bed6d81687c968340f160d0af21 (diff)
downloadskribilo-9a02dfaefa324ac1e5df3adc11003e1b578cfe64.tar.gz
skribilo-9a02dfaefa324ac1e5df3adc11003e1b578cfe64.tar.lz
skribilo-9a02dfaefa324ac1e5df3adc11003e1b578cfe64.zip
Made `parse-list-of' tail-recursive.
* src/guile/skribilo/skribe/api.scm (parse-list-of): Made tail-recursive, thereby fixing potential stack overflows (e.g., when building the user manual) and perhaps slightly improving performance. git-archimport-id: lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-9
Diffstat (limited to 'src')
-rw-r--r--src/guile/skribilo/skribe/api.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/guile/skribilo/skribe/api.scm b/src/guile/skribilo/skribe/api.scm
index 2cd8b2e..2a4d0ae 100644
--- a/src/guile/skribilo/skribe/api.scm
+++ b/src/guile/skribilo/skribe/api.scm
@@ -551,12 +551,13 @@
(null? (cdr lst)))
(parse-list-of for markup (car lst)))
(else
- (let loop ((lst lst))
+ (let loop ((lst lst)
+ (result '()))
(cond
((null? lst)
- '())
+ (reverse! result))
((pair? (car lst))
- (loop (car lst)))
+ (loop (car lst) result))
(else
(let ((r (car lst)))
(if (not (is-markup? r markup))
@@ -567,7 +568,7 @@
(markup-markup r)
(find-runtime-type r))
markup)))
- (cons r (loop (cdr lst))))))))))
+ (loop (cdr lst) (cons r result)))))))))
;*---------------------------------------------------------------------*/
;* itemize ... */