From 587fc32e72650bbcd6f81fd435dcd47e52496215 Mon Sep 17 00:00:00 2001 From: erana Date: Tue, 17 Jan 2012 21:46:05 +0900 Subject: [PATCH] schemedoc own parser - 5 --- scsh/schemedoc/schemedoc.scm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scsh/schemedoc/schemedoc.scm b/scsh/schemedoc/schemedoc.scm index 05dafda..7039b04 100644 --- a/scsh/schemedoc/schemedoc.scm +++ b/scsh/schemedoc/schemedoc.scm @@ -76,9 +76,20 @@ (parse in) ) (lambda (l) - (display l) + ;;(write l) l))) - (let ((in (open-input-file filename))) + (let ((in (open-input-file filename))) ;; FIXME with- (read-rec in))) +(define (schemedoc-parser-grep filename) + (let ((le (schemedoc-parser-doc filename)) + (line "") + (lines '())) + (do ((l le (cdr l))) + ((or (eof-object? l) + (and (eq? (car l) #\newline)(string<=? "=item" line))) + (set! lines (append lines (list line))) + (set! line "")) + (set! line (string-append line (string (car l)))) + (for-each display lines))))