From 0257ab38c6792c81b2faa6d78169b0eda5e944fe Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 4 Apr 2011 00:52:34 +0900 Subject: [PATCH] don't truncate trailing newlines before } --- lib/chibi/scribble.scm | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/chibi/scribble.scm b/lib/chibi/scribble.scm index 8c40ea9b..cc3ebdb1 100644 --- a/lib/chibi/scribble.scm +++ b/lib/chibi/scribble.scm @@ -232,17 +232,10 @@ (lp (cdr p) (cons (read-char in) ls)))))) (else (tok (cons c str) res punc (- depth 1))))) ((eqv? c #\newline) - (let* ((first? (and (null? res) (null? str))) - ;;(res (collect (drop-while char-whitespace? str) res)) - (res (collect str res)) - (res (if (or first? (eqv? #\} (peek-char in))) + (let* ((res (collect str res)) + (res (if (and (null? res) (null? str)) res (cons "\n" res)))) - ;; (let lp ((ls '())) - ;; (let ((c (peek-char in))) - ;; (cond - ;; ((char-whitespace? c) (read-char in) (lp (cons c ls))) - ;; (else (tok (if (eqv? c #\}) ls '()) res punc depth))))) (tok '() res punc depth))) (else (tok (cons c str) res punc depth)))))