Skip Menu |
Report information
Id: 75592
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: cognominal <cognominal [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Long running unclosed quotes trigger unhelpful message
Date: Mon, 7 Jun 2010 23:23:20 +0200
To: bug <rakudobug [...] perl.org>
From: Stéphane Payrard <cognominal [...] gmail.com>
I am probably a lousy programmer but I hit again and again that unhelpful message. How to reproduce : eval "{\n\n\n\n\'}" Unable to parse blockoid, couldn't find final '}' at line 1 Note that the opening quotes are many lines below the start of the blockoid and there may be many statements between them. So the line number in the error is unhelpful. In the simplest case, the quote rules fails because the end of the file has been reached. I don't see the need to backtrack and to fail the blockoid. In more complicated cases, the quote rule reduces but it eats way more characters than the programmer intended inluding '}' chars that should terminate blockoids. The result is triggering the same message or some others. I don't know if there is a way to detect the true problem instead of emitting spurious messages. Probably we should indicate the reduced quotes involving many lines as suspicious when failing to reduce a blockoid. They are bad style anyway because heredocs are the preferred style for many lines quoted stuff. But heredocs are not implemented yet. -- cognominal stef
Subject: Re: [perl #75592] Long running unclosed quotes trigger unhelpful message
Date: Tue, 08 Jun 2010 13:35:39 +0200
To: perl6-compiler [...] perl.org
From: Moritz Lenz <moritz [...] faui2k3.org>
Download (untitled) / with headers
text/plain 1.1k
Am 07.06.2010 23:23, schrieb Stephane Payrard (via RT): Show quoted text
> # New Ticket Created by Stephane Payrard > # Please include the string: [perl #75592] > # in the subject line of all future correspondence about this issue. > #<URL: http://rt.perl.org/rt3/Ticket/Display.html?id=75592> > > > I am probably a lousy programmer but I hit again and again that > unhelpful message. > > How to reproduce : > > eval "{\n\n\n\n\'}" > > Unable to parse blockoid, couldn't find final '}' at line 1 > > Note that the opening quotes are many lines below the start of the > blockoid and there may be many statements between them. > So the line number in the error is unhelpful. > > In the simplest case, the quote rules fails because the end of the > file has been reached. I don't see the need > to backtrack and to fail the blockoid.
That's not what's happening. The blockoid is embedded in the quote, so it fails first, and then the quote rule fails. If you're interested in fixing this, you might look at how STD.pm does it. Some of its constructs are easily transferable into rakudo's grammar, some not as easy (but need to be ported at some point anyway). Cheers, Moritz
Subject: Re: [perl #75592] Long running unclosed quotes trigger unhelpful message
Date: Tue, 8 Jun 2010 21:40:10 +0200
To: perl6-bugs-followup [...] perl.org
From: Stéphane Payrard <cognominal [...] gmail.com>
Download (untitled) / with headers
text/plain 1.4k
Also implementing :: will help for more precise errors reports. That one is one pmichaud plate that is already full On Tue, Jun 8, 2010 at 1:36 PM, Moritz Lenz via RT <perl6-bugs-followup@perl.org> wrote: Show quoted text
> Am 07.06.2010 23:23, schrieb Stephane Payrard (via RT):
>> # New Ticket Created by  Stephane Payrard >> # Please include the string:  [perl #75592] >> # in the subject line of all future correspondence about this issue. >> #<URL: http://rt.perl.org/rt3/Ticket/Display.html?id=75592> >> >> >> I am probably a lousy programmer but I hit again and again that >> unhelpful message. >> >> How to reproduce : >> >> eval "{\n\n\n\n\'}" >> >> Unable to parse blockoid, couldn't find final '}' at line 1 >> >> Note that the opening quotes are many lines below the start of the >> blockoid and there may be many statements between them. >> So the line number in the error is unhelpful. >> >> In the simplest case, the quote rules fails because the end of the >> file has been reached. I don't see the need >> to backtrack and to fail the blockoid.
> > That's not what's happening. > The blockoid is embedded in the quote, so it fails first, and then the > quote rule fails. > > If you're interested in fixing this, you might look at how STD.pm does > it. Some of its constructs are easily transferable into rakudo's > grammar, some not as easy (but need to be ported at some point anyway). > > Cheers, > Moritz > > >
-- cognominal stef
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 723b
On Mon Jun 07 14:23:47 2010, cognominal wrote: Show quoted text
> I am probably a lousy programmer but I hit again and again that > unhelpful message. > > How to reproduce : > > eval "{\n\n\n\n\'}" > > Unable to parse blockoid, couldn't find final '}' at line 1
Getting closer (I'm assuming the \n's above were meant to be newlines, but I did it both ways below) although the given line numbers are wrong below: $ cat a.p6 eval "{\n\n\n\n\'}" $ ./perl6 a.p6 ===SORRY!=== Unable to parse expression in block; couldn't find final '}' at line 2, near "\\n\\n\\n\\n\\'" $ cat b.p6 eval "{ \'}" $ ./perl6 b.p6 ===SORRY!=== Unable to parse expression in quote:sym<apos>; couldn't find final "'" at line 7, near "" -- Will "Coke" Coleda
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 723b
On Mon Jun 07 14:23:47 2010, cognominal wrote: Show quoted text
> I am probably a lousy programmer but I hit again and again that > unhelpful message. > > How to reproduce : > > eval "{\n\n\n\n\'}" > > Unable to parse blockoid, couldn't find final '}' at line 1
Getting closer (I'm assuming the \n's above were meant to be newlines, but I did it both ways below) although the given line numbers are wrong below: $ cat a.p6 eval "{\n\n\n\n\'}" $ ./perl6 a.p6 ===SORRY!=== Unable to parse expression in block; couldn't find final '}' at line 2, near "\\n\\n\\n\\n\\'" $ cat b.p6 eval "{ \'}" $ ./perl6 b.p6 ===SORRY!=== Unable to parse expression in quote:sym<apos>; couldn't find final "'" at line 7, near "" -- Will "Coke" Coleda
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 1.3k
On Sat Nov 17 11:40:48 2012, coke wrote: Show quoted text
> On Mon Jun 07 14:23:47 2010, cognominal wrote:
> > I am probably a lousy programmer but I hit again and again that > > unhelpful message. > > > > How to reproduce : > > > > eval "{\n\n\n\n\'}" > > > > Unable to parse blockoid, couldn't find final '}' at line 1
> > Getting closer (I'm assuming the \n's above were meant to be newlines, > but I did it both ways > below) although the given line numbers are wrong below: > > $ cat a.p6 > eval "{\n\n\n\n\'}" > $ ./perl6 a.p6 > ===SORRY!=== > Unable to parse expression in block; couldn't find final '}' at line > 2, near "\\n\\n\\n\\n\\'" > $ cat b.p6 > eval "{ > > > > \'}" > $ ./perl6 b.p6 > ===SORRY!=== > Unable to parse expression in quote:sym<apos>; couldn't find final "'" > at line 7, near ""
Slight improvements; line number in the second one is now only off by one, error messages now reference the file. $ cat a.p6 eval "{\n\n\n\n\'}" $ ./perl6 a.p6 ===SORRY!=== Error while compiling a.p6 Confused at a.p6:1 ------> eval "{\n\⏏n\n\n\'}" $ cat b.p6 eval "{ \'}" $ ./perl6 b.p6 ===SORRY!=== Error while compiling b.p6 Unable to parse expression in single quotes; couldn't find final "'" at b.p6:6 ------> <BOL>⏏<EOL> expecting any of: single quotes term$ ./perl6 --version This is perl6 version 2015.07.1-898-g3655638 built on MoarVM version 2015.08-34-g113c3b5 -- Will "Coke" Coleda


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org