Remove comments.

This commit is contained in:
Dominik Pantůček 2023-03-12 10:09:18 +01:00
parent 61e0043d08
commit 5a68b1870e

View file

@ -331,10 +331,19 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 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
;; rest of the line. If the line doesn't contain anything, returns #f.
(define (parse-member-line l)
(let ((sp (string-split l " ")))
(let ((sp (string-split (mfp:line:remove-comments l) " ")))
(and sp
(not (null? sp))
(list (string->symbol (car sp))