mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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:
parent
e3a69f37ca
commit
2e3d4f16d4
2 changed files with 9 additions and 0 deletions
|
@ -414,6 +414,7 @@ the list KEY. For instance a KEY (a b) would retrieve alist[a][b]."
|
||||||
local-time)
|
local-time)
|
||||||
tails)))
|
tails)))
|
||||||
('array (list))
|
('array (list))
|
||||||
|
('inline-table '())
|
||||||
(('inline-table tails ...)
|
(('inline-table tails ...)
|
||||||
(eval (keyword-flatten '(keyval) tails) '() '()))))
|
(eval (keyword-flatten '(keyval) tails) '() '()))))
|
||||||
|
|
||||||
|
|
|
@ -396,6 +396,14 @@ fruit.apple.taste.sweet = true"))
|
||||||
point = { x = 1, y = 2 }
|
point = { x = 1, y = 2 }
|
||||||
animal = { type.name = \"pug\" }"))
|
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"
|
(test-error "parse-toml: Invalid assignment to inline table"
|
||||||
#t
|
#t
|
||||||
(parse-toml "[product]
|
(parse-toml "[product]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue