From 5a68b1870e04427c6c3efcde75580085991b0717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Sun, 12 Mar 2023 10:09:18 +0100 Subject: [PATCH] Remove comments. --- brmsaptool.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/brmsaptool.scm b/brmsaptool.scm index 1ac79c5..4e1574b 100644 --- a/brmsaptool.scm +++ b/brmsaptool.scm @@ -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))