GNU bug report logs - #9672
bug in SRFI-30 comment parser

Previous Next

Package: guile;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Tue, 4 Oct 2011 21:48:01 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9672 in the body.
You can then email your comments to 9672 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#9672; Package guile. (Tue, 04 Oct 2011 21:48:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bruno Haible <bruno <at> clisp.org>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 04 Oct 2011 21:48:02 GMT) Full text and rfc822 format available.

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

From: Bruno Haible <bruno <at> clisp.org>
To: bug-guile <at> gnu.org
Subject: bug in SRFI-30 comment parser
Date: Tue, 4 Oct 2011 23:45:19 +0200
Hi,

Block comments whose contents end with an odd number of vertical bars are not
parsed correctly by guile-2.0.2.

The guile manual [1] says:
  "Guile (starting from version 2.0) supports nested block comments
   as specified by R6RS and SRFI-30"

R6RS [2] says:
  "Block comments may be indicated with properly nested #|and |# pairs."

More formally, SRFI-30 [3] implies that in particular

  #| <comment-text> |#

is a comment, where

  <comment-text> ---> <character sequence not containing #| or |#>

Now look at this guile session: When I use a <comment-text> that ends in
1 or 3 or 5 ... trailing vertical bars, guile misses the end of the
block comment and hangs.

scheme@(guile-user)> '(a #|foo|# b)
$1 = (a b)
scheme@(guile-user)> '(a #|foo|||# b)
$2 = (a b)
scheme@(guile-user)> '(a #|foo|||||# b)
$3 = (a b)
scheme@(guile-user)> '(a #|foo||# b)
[hangs]

scheme@(guile-user)> '(a #|foo||||# b)
[hangs]

The bug is most likely located in libguile/read.c,
function scm_read_r6rs_block_comment, line 1204.

Bruno

[1] http://www.gnu.org/software/guile/manual/html_node/Block-Comments.html
[2] http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.2.3
[3] http://srfi.schemers.org/srfi-30/srfi-30.html
--
In memoriam Irena Iłłakowicz <http://en.wikipedia.org/wiki/Irena_Iłłakowicz>




Reply sent to Andy Wingo <wingo <at> pobox.com>:
You have taken responsibility. (Wed, 05 Oct 2011 18:51:02 GMT) Full text and rfc822 format available.

Notification sent to Bruno Haible <bruno <at> clisp.org>:
bug acknowledged by developer. (Wed, 05 Oct 2011 18:51:03 GMT) Full text and rfc822 format available.

Message #10 received at 9672-done <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Bruno Haible <bruno <at> clisp.org>
Cc: 9672-done <at> debbugs.gnu.org
Subject: Re: bug#9672: bug in SRFI-30 comment parser
Date: Wed, 05 Oct 2011 20:49:53 +0200
Thanks for the note, Bruno.  I have fixed the bug in stable-2.0.

Cheers,

Andy
-- 
http://wingolog.org/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 03 Nov 2011 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.