1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-28 12:01:49 +02:00

records: `recutils->alist' recognizes comments.

* guix/records.scm (%recutils-comment-rx): New variable.
  (recutils->alist): Match comments.
* tests/records.scm ("recutils->alist"): Add comments.
This commit is contained in:
Ludovic Courtès
2013-07-10 17:01:47 +02:00
parent fdc1bf659d
commit b7b8828801
2 changed files with 23 additions and 3 deletions
+12 -2
View File
@@ -138,13 +138,23 @@
("Something_else" . "chbouib"))
(("Name" . "bar")
("Version" . "1.5")))
(let ((p (open-input-string "Name: foo
(let ((p (open-input-string "
# Comment following an empty line, and
# preceding a couple of empty lines, all of
# which should be silently consumed.
Name: foo
Version: 0.1
# Comment right in the middle,
# spanning two lines.
Synopsis: foo bar
Something_else: chbouib
# Comment right before.
Name: bar
Version: 1.5")))
Version: 1.5
# Comment at the end.")))
(list (recutils->alist p)
(recutils->alist p))))