Remove comments.
This commit is contained in:
parent
61e0043d08
commit
5a68b1870e
1 changed files with 10 additions and 1 deletions
|
@ -331,10 +331,19 @@
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Member info data file
|
;; Member info data file
|
||||||
|
|
||||||
|
;; Member File Parser: remove comments from line and return the result
|
||||||
|
(define (mfp:line:remove-comments l)
|
||||||
|
(let ((si (substring-index "#" l)))
|
||||||
|
(if si
|
||||||
|
(if (= si 0)
|
||||||
|
""
|
||||||
|
(car (string-chop l si)))
|
||||||
|
l)))
|
||||||
|
|
||||||
;; Parses given key-value line. Key is up to first space, value is the
|
;; Parses given key-value line. Key is up to first space, value is the
|
||||||
;; rest of the line. If the line doesn't contain anything, returns #f.
|
;; rest of the line. If the line doesn't contain anything, returns #f.
|
||||||
(define (parse-member-line l)
|
(define (parse-member-line l)
|
||||||
(let ((sp (string-split l " ")))
|
(let ((sp (string-split (mfp:line:remove-comments l) " ")))
|
||||||
(and sp
|
(and sp
|
||||||
(not (null? sp))
|
(not (null? sp))
|
||||||
(list (string->symbol (car sp))
|
(list (string->symbol (car sp))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue