schemedoc own parser load.scm - 1
This commit is contained in:
parent
587fc32e72
commit
5496960c82
|
@ -32,9 +32,28 @@
|
||||||
;; main program
|
;; main program
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(define $SCHEMEDOCDIR (getenv "SCHEMEDOCDIR"))
|
(define ask (getenv "SCHEMEDOCDIR"))
|
||||||
(case $SCHEMEDOCDIR
|
(case ask
|
||||||
((#f) (for-each display
|
((#f) (begin (for-each
|
||||||
'("set your SCHEMEDOCDIR env var to the paths where pods and sods reside." (eoln) "exiting" (eoln))
|
display
|
||||||
|
'("set your SCHEMEDOCDIR env var to the paths where pods and sods reside." (eoln) "exiting" (eoln)))
|
||||||
(exit) ;; NOTE exit
|
(exit) ;; NOTE exit
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
|
||||||
|
;;(for-each schemedoc-parser-grep SCHEMEDOCDIR)
|
||||||
|
(define directoriesl (schemedoc-get-env-list SCHEMEDOCDIR))
|
||||||
|
(for-each display directoriesl)
|
||||||
|
(display directoriesl)
|
||||||
|
(do ((l directoriesl (cdr l)))
|
||||||
|
((null? l)
|
||||||
|
0)
|
||||||
|
(display (directory-files (car l)) )
|
||||||
|
(do ((l2 (directory-files (car l)) (cdr l2)))
|
||||||
|
((null? l2)0)
|
||||||
|
(schemedoc-parser-grep (car l2)))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;;(for-each directory-files directoriesl)
|
||||||
|
|
|
@ -87,9 +87,23 @@
|
||||||
(line "")
|
(line "")
|
||||||
(lines '()))
|
(lines '()))
|
||||||
(do ((l le (cdr l)))
|
(do ((l le (cdr l)))
|
||||||
((or (eof-object? l)
|
((eof-object? l)0)
|
||||||
(and (eq? (car l) #\newline)(string<=? "=item" line)))
|
(if (and (eq? (car l) #\newline)(string<=? "=item" line))
|
||||||
|
(begin
|
||||||
(set! lines (append lines (list line)))
|
(set! lines (append lines (list line)))
|
||||||
(set! line ""))
|
(set! line "")))
|
||||||
(set! line (string-append line (string (car l))))
|
(set! line (string-append line (string (car l)))))
|
||||||
(for-each display lines))))
|
(for-each display lines)))
|
||||||
|
|
||||||
|
(define (schemedoc-get-env-list SCHEMEDOCDIR)
|
||||||
|
(let ((directory "")
|
||||||
|
(directories '()))
|
||||||
|
(do ((i 0 (+ i 1)))
|
||||||
|
((>= i (string-length SCHEMEDOCDIR))
|
||||||
|
(set! directories (append directories (list directory))))
|
||||||
|
(if (eq? (string-ref SCHEMEDOCDIR i) #\:)
|
||||||
|
(begin
|
||||||
|
(set! directories (append directories (list directory)))
|
||||||
|
(set! directory "")))
|
||||||
|
(set! directory (string-append directory (string (string-ref SCHEMEDOCDIR i)))))
|
||||||
|
directories))
|
Loading…
Reference in New Issue