[PATCH] guix: toml: Fix evaluation of empty inline tables.

  • Done
  • quality assurance status badge
Details
3 participants
  • Lars-Dominik Braun
  • Ludovic Courtès
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Lars-Dominik Braun
Severity
normal
L
L
Lars-Dominik Braun wrote on 20 Dec 2024 12:29
(address . guix-patches@gnu.org)
a150f99f13be1d0364f961b7883278cacf2fdb53.1734694094.git.lars@6xq.net
* 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
---
guix/build/toml.scm | 1 +
tests/toml.scm | 8 ++++++++
2 files changed, 9 insertions(+)

Toggle diff (35 lines)
diff --git a/guix/build/toml.scm b/guix/build/toml.scm
index 81b54fa5b7..a9be0887e7 100644
--- a/guix/build/toml.scm
+++ b/guix/build/toml.scm
@@ -414,6 +414,7 @@ (define (eval-toml-file parse-tree)
local-time)
tails)))
('array (list))
+ ('inline-table '())
(('inline-table tails ...)
(eval (keyword-flatten '(keyval) tails) '() '()))))
diff --git a/tests/toml.scm b/tests/toml.scm
index cd8e4d2338..64bc667f0c 100644
--- a/tests/toml.scm
+++ b/tests/toml.scm
@@ -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]

base-commit: 946e48d1d87ec451e7a6315712f2e86c79961a51
--
2.45.2
L
L
Ludovic Courtès wrote on 25 Dec 2024 23:31
(name . Lars-Dominik Braun)(address . lars@6xq.net)(address . 74993@debbugs.gnu.org)
87a5cj2y48.fsf@gnu.org
Lars-Dominik Braun <lars@6xq.net> skribis:

Toggle quote (5 lines)
> * 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

LGTM!
L
L
Lars-Dominik Braun wrote on 26 Dec 2024 22:14
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 74993@debbugs.gnu.org)
Z23HGwEdj5tR8E1e@philomena
Hi,

Toggle quote (2 lines)
> LGTM!

thanks. Since pyproject-build-system depends on (guix build toml) this
is a world-rebuilding change. Can we piggyback this patch onto another
(possibly unrelated) world-rebuilding branch?

Lars
L
L
Ludovic Courtès wrote on 28 Dec 2024 18:24
(name . Lars-Dominik Braun)(address . lars@6xq.net)(address . 74993@debbugs.gnu.org)
87ldvzvhy7.fsf@gnu.org
Hi,

Lars-Dominik Braun <lars@6xq.net> skribis:

Toggle quote (6 lines)
>> LGTM!
>
> thanks. Since pyproject-build-system depends on (guix build toml) this
> is a world-rebuilding change. Can we piggyback this patch onto another
> (possibly unrelated) world-rebuilding branch?

Oh, good point. I guess this can go to the ‘python-team’ branch?

Ludo’.
R
R
Ricardo Wurmus wrote 4 days ago
[PATCH] guix: toml: Fix evaluation of empty inline tables.
(address . 74993-done@debbugs.gnu.org)(name . Lars-Dominik Braun)(address . lars@6xq.net)
874j2d5smw.fsf@elephly.net
I've just pushed it to the python-team branch.

--
Ricardo
Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 74993@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 74993
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch