GNU bug report logs

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

PackageSource(s)Maintainer(s)
guix-patches PTS Buildd Popcon
Full log

Message #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

Received: (at submit) by debbugs.gnu.org; 20 Dec 2024 11:29:52 +0000
From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 20 06:29:52 2024
Received: from localhost ([127.0.0.1]:41872 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1tObCZ-0003Fh-SW
	for submit@debbugs.gnu.org; Fri, 20 Dec 2024 06:29:52 -0500
Received: from lists.gnu.org ([209.51.188.17]:35930)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lars@6xq.net>) id 1tObCU-0003FU-IC
 for submit@debbugs.gnu.org; Fri, 20 Dec 2024 06:29:50 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <lars@6xq.net>) id 1tObCT-0005qE-V8
 for guix-patches@gnu.org; Fri, 20 Dec 2024 06:29:46 -0500
Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <lars@6xq.net>) id 1tObCS-00031e-5J
 for guix-patches@gnu.org; Fri, 20 Dec 2024 06:29:45 -0500
Received: from smtp1.mailbox.org (smtp1.mailbox.org
 [IPv6:2001:67c:2050:b231:465::1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4YF4vL2kVlz9t7b
 for <guix-patches@gnu.org>; Fri, 20 Dec 2024 12:29:34 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001;
 t=1734694174;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type;
 bh=DvakTHMVkHDdZA0ezy+GELedGZnGeTV4NB6GKKeFuTk=;
 b=iLghc8Cv7iFEDL9Q79EOPwydoPXajBA3FUMtagVuwQ32VdyLvfznBDCgjXeFstaECZEr6U
 rPySP5fetsvW5GpzEdG8al9pNUF6ykE9+bxp5V3AbWUzBtuwbdk1uETa1T2vQeB5IptwTF
 /hk31hGDfMwYj+GIgO7V30o2Tk793ZmCTig1xtmFD2bXoHf2mOSipq6AnyQ6N7EVKAKaqH
 hcUpjfVVD4WGEaz9ZP5p0UrTTMk4vlbXwZio87f9VZngeq7aJkU3mgNjhSrbMhxI6upN1m
 H+LoZYaa4wLRqbXnPMym8EpQtvrnME6x/i1vdyUfjofdYdHCMhzhf4ZSvy57Dw==
Date: Fri, 20 Dec 2024 12:29:32 +0100
From: Lars-Dominik Braun <lars@6xq.net>
To: guix-patches@gnu.org
Subject: [PATCH] guix: toml: Fix evaluation of empty inline tables.
Message-ID: <a150f99f13be1d0364f961b7883278cacf2fdb53.1734694094.git.lars@6xq.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Rspamd-Queue-Id: 4YF4vL2kVlz9t7b
Received-SPF: pass client-ip=2001:67c:2050:0:465::202;
 envelope-from=lars@6xq.net; helo=mout-p-202.mailbox.org
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -2.6 (--)
* 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(+)

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





Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 11:29:20 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.