From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#48089: Guile 3.0.6 returns zero-indexed locations for =?UTF-8?Q?=E2=80=98read-error=E2=80=99?= Date: Thu, 29 Apr 2021 22:04:52 +0200 Message-ID: <8735v8luvv.fsf@pobox.com> References: <877dkmox7x.fsf@inria.fr> <87o8dxmo48.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3959"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: 48089-done@debbugs.gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Thu Apr 29 22:07:57 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 1lcCx2-0000xA-SA for guile-bugs@m.gmane-mx.org; Thu, 29 Apr 2021 22:07:56 +0200 Original-Received: from localhost ([::1]:50816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcCx1-0000eh-U3 for guile-bugs@m.gmane-mx.org; Thu, 29 Apr 2021 16:07:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcCvC-0008EQ-44 for bug-guile@gnu.org; Thu, 29 Apr 2021 16:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcCvB-0004xW-Sq for bug-guile@gnu.org; Thu, 29 Apr 2021 16:06:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lcCvB-0000Jj-Nn for bug-guile@gnu.org; Thu, 29 Apr 2021 16:06:01 -0400 Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Thu, 29 Apr 2021 20:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 48089 X-GNU-PR-Package: guile Mail-Followup-To: 48089@debbugs.gnu.org, wingo@pobox.com, ludo@gnu.org Original-Received: via spool by 48089-done@debbugs.gnu.org id=D48089.16197267111153 (code D ref 48089); Thu, 29 Apr 2021 20:06:01 +0000 Original-Received: (at 48089-done) by debbugs.gnu.org; 29 Apr 2021 20:05:11 +0000 Original-Received: from localhost ([127.0.0.1]:56852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcCuM-0000IW-RT for submit@debbugs.gnu.org; Thu, 29 Apr 2021 16:05:11 -0400 Original-Received: from fanzine.igalia.com ([178.60.130.6]:47825) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcCuK-0000IG-Qh for 48089-done@debbugs.gnu.org; Thu, 29 Apr 2021 16:05:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=gaUmfhUkQeZJ+g6WQmUB4h9jYb5mNB+rn4WoMgZStSk=; b=CdEW6ShprKqDBqzy4K41Ldi5njVVfUynEW261DlV5f2MdZF+/H/sdlTUn2WCHIsXcrWdZXaYsHHJ3FyO/hrMoYCjHMZRX4+4xNVtWvPapcovVeGCWZGyCA4lJ+YlIlKPIJX4GqdJwnEweGDI4OS8gHQ/kfU7y/UvRZwbmtj0j1ip8Sqq4k3V4JVtMVxHBAxq+V3G99sPuIv0UxVbwin4Hbg2PskpYwQULuI7ZJGhBqKpJWsVj+frS1mxgPhve05C4ycmK3lvQP/IO9LgNu4Rzztm3L4t9j2a368WCJgFw+2GwKVDbj2mgY4SItBAMgQXYxO6ONHRnrztGKwc2zLTiw==; Original-Received: from 82-65-63-215.subs.proxad.net ([82.65.63.215] helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1lcCuF-0007EF-5l; Thu, 29 Apr 2021 22:05:03 +0200 In-Reply-To: <87o8dxmo48.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 29 Apr 2021 11:33:27 +0200") 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:10023 Archived-At: Done :) On Thu 29 Apr 2021 11:33, Ludovic Court=C3=A8s writes: > Ludovic Court=C3=A8s skribis: > >> Guile 3.0.6 returns zero-indexed (instead of one-indexed) source code >> locations for =E2=80=98read-error=E2=80=99. Here=E2=80=99s a 3.0.6/3.0.= 5 comparison: >> >> $ /gnu/store/r2nr74rwhpqg16y1lyi6l0jn3lwx4yyz-guile-3.0.6/bin/guile <(e= cho '(') >> ice-9/read.scm:126:4: In procedure lp: >> /dev/fd/63:1:0: unexpected end of input while searching for: ) >> $ guile <(echo '(') >> ERROR: In procedure primitive-load: >> In procedure scm_i_lreadparen: /dev/fd/63:2:1: end of file > > Here=E2=80=99s a test case waiting to succeed! :-) > > diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test > index fad531b39..231e69553 100644 > --- a/test-suite/tests/reader.test > +++ b/test-suite/tests/reader.test > @@ -212,6 +212,18 @@ >=20=20 > > (with-test-prefix "mismatching parentheses" > + (pass-if-equal "read-error location" > + '("foo.scm:3:1: unexpected end of input while searching for: ~A" #= \)) > + (catch 'read-error > + (lambda () > + ;; The missing closing paren error should be located on line 3, > + ;; column 1 (one-indexed). > + (call-with-input-string "\n (hi there!\n" > + (lambda (port) > + (set-port-filename! port "foo.scm") > + (read port)))) > + (lambda (key proc message args . _) > + (cons message args)))) > (pass-if-exception "opening parenthesis" > exception:eof > (read-string "(")) > > > Ludo=E2=80=99.