guix: toml: Fix evaluation of empty inline tables.

* guix/build/toml.scm (eval-toml-file): Add pattern for empty inline table.
* tests/toml.scm ("parse-toml: Empty inline table"): New testcase.

Change-Id: I69663af2a861716acfb801fad4474e029e102a1b
This commit is contained in:
Lars-Dominik Braun 2024-12-20 12:29:32 +01:00 committed by Ricardo Wurmus
parent ccea7539d8
commit 55d4c898dd
No known key found for this signature in database
GPG key ID: 197A5888235FACAC
2 changed files with 9 additions and 0 deletions

View file

@ -414,6 +414,7 @@ (define (eval-value value)
local-time)
tails)))
('array (list))
('inline-table '())
(('inline-table tails ...)
(eval (keyword-flatten '(keyval) tails) '() '()))))

View file

@ -396,6 +396,14 @@ (define-module (test-toml)
point = { x = 1, y = 2 }
animal = { type.name = \"pug\" }"))
(test-equal "parse-toml: Empty inline table"
'(("name")
("point")
("animal"))
(parse-toml "name = {}
point = { }
animal = { }"))
(test-error "parse-toml: Invalid assignment to inline table"
#t
(parse-toml "[product]