From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: lloda Newsgroups: gmane.lisp.guile.bugs,gmane.lisp.guile.devel Subject: bug#49623: [PATCH v2] Parse #{{}}# properly. Date: Mon, 2 Aug 2021 18:37:40 +0200 Message-ID: References: <188d4583d3c9a921e7bdc8556befc4c320b99dd6.camel@telenet.be> <2fed32729a645814cc8912a5d767b209c8075ed6.camel@telenet.be> <71e366c5e151d73c9b9a33345833f379d4c6d4f5.camel@telenet.be> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_FBF88756-051D-4154-80BA-1C70C79AA6E6" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20520"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49623-done@debbugs.gnu.org, guile-devel To: Maxime Devos Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Mon Aug 02 18:38:10 2021 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mAax8-00057O-7v for guile-bugs@m.gmane-mx.org; Mon, 02 Aug 2021 18:38:10 +0200 Original-Received: from localhost ([::1]:37320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAax6-0005dP-58 for guile-bugs@m.gmane-mx.org; Mon, 02 Aug 2021 12:38:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAax0-0005b1-JS for bug-guile@gnu.org; Mon, 02 Aug 2021 12:38:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55827) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAax0-0005dX-7U for bug-guile@gnu.org; Mon, 02 Aug 2021 12:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mAax0-0006Gm-4v for bug-guile@gnu.org; Mon, 02 Aug 2021 12:38:02 -0400 Resent-From: lloda Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Mon, 02 Aug 2021 16:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 49623 X-GNU-PR-Package: guile Mail-Followup-To: 49623@debbugs.gnu.org, lloda@sarc.name, maximedevos@telenet.be Original-Received: via spool by 49623-done@debbugs.gnu.org id=D49623.162792227124077 (code D ref 49623); Mon, 02 Aug 2021 16:38:01 +0000 Original-Received: (at 49623-done) by debbugs.gnu.org; 2 Aug 2021 16:37:51 +0000 Original-Received: from localhost ([127.0.0.1]:39138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAawp-0006GH-Ee for submit@debbugs.gnu.org; Mon, 02 Aug 2021 12:37:51 -0400 Original-Received: from mta-12-3.privateemail.com ([198.54.118.202]:27954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAawn-0006G2-JM for 49623-done@debbugs.gnu.org; Mon, 02 Aug 2021 12:37:50 -0400 Original-Received: from mta-12.privateemail.com (localhost [127.0.0.1]) by mta-12.privateemail.com (Postfix) with ESMTP id 9C77A18000A4; Mon, 2 Aug 2021 12:37:43 -0400 (EDT) Original-Received: from [192.168.1.105] (unknown [10.20.151.200]) by mta-12.privateemail.com (Postfix) with ESMTPA id CF34D18001DF; Mon, 2 Aug 2021 12:37:42 -0400 (EDT) In-Reply-To: <71e366c5e151d73c9b9a33345833f379d4c6d4f5.camel@telenet.be> X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10158 gmane.lisp.guile.devel:20812 Archived-At: --Apple-Mail=_FBF88756-051D-4154-80BA-1C70C79AA6E6 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Applied in c78c130b1ddef6d6c290533f74ce1fbd51a4b19d. Thank you! > On 20 Jul 2021, at 12:54, Maxime Devos wrote: > > Maxime Devos schreef op zo 18-07-2021 om 21:47 [+0200]: >> It turns out that the test fails when the patch >> is applies to guile@3.0.7. I'll rebase and try >> to figure things out. > > With the revised patch, tests succeed and the Guile > library now compiles successfully. > > Greetings, > Maxime. --Apple-Mail=_FBF88756-051D-4154-80BA-1C70C79AA6E6 Content-Disposition: attachment; filename=0001-ice-9-read-Parse-properly.patch Content-Type: text/x-patch; x-unix-mode=0644; name="0001-ice-9-read-Parse-properly.patch" Content-Transfer-Encoding: quoted-printable =46rom 40b0b29c05d521cd8901988fa2bc71547f917f48 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Sun, 18 Jul 2021 19:59:32 +0200 Subject: [PATCH] ice-9/read: Parse #{}}# properly. This is a regression since Guile 3.0.2 and breaks compilation of a Guile library. * module/ice-9/read.scm (%read)[read-parenthesized]: When SAW-BRACE? is #t but CH isn't #\#, don't eat CH. * test-suite/tests/reader.test ("#{}#): Add four test cases. --- module/ice-9/read.scm | 7 +++++-- test-suite/tests/reader.test | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/module/ice-9/read.scm b/module/ice-9/read.scm index ac407739f..283933064 100644 --- a/module/ice-9/read.scm +++ b/module/ice-9/read.scm @@ -556,12 +556,15 @@ (string->symbol (list->string (let lp ((saw-brace? #f)) - (let ((ch (next-not-eof))) + (let lp/inner ((ch (next-not-eof)) + (saw-brace? saw-brace?)) (cond (saw-brace? (if (eqv? ch #\#) '() - (cons #\} (lp #f)))) + ;; Don't eat CH, see + ;; = . + (cons #\} (lp/inner ch #f)))) ((eqv? ch #\}) (lp #t)) ((eqv? ch #\\) diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test index 1481a0a5d..ad7c6d575 100644 --- a/test-suite/tests/reader.test +++ b/test-suite/tests/reader.test @@ -536,6 +536,11 @@ =20 (with-test-prefix "#{}#" (pass-if (equal? (read-string "#{}#") '#{}#)) + ;; See + (pass-if (equal? (read-string "#{}}#") (string->symbol "}"))) + (pass-if (equal? (read-string "#{}}}#") (string->symbol "}}"))) + (pass-if (equal? (read-string "#{{}}#") (string->symbol "{}"))) + (pass-if (equal? (read-string "#{{}b}#") (string->symbol "{}b"))) (pass-if (not (equal? (read-string "(a #{.}# b)") '(a . b)))) (pass-if (equal? (read-string "#{a}#") 'a)) (pass-if (equal? (read-string "#{a b}#") '#{a b}#)) --=20 2.32.0 --Apple-Mail=_FBF88756-051D-4154-80BA-1C70C79AA6E6 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_FBF88756-051D-4154-80BA-1C70C79AA6E6--