Skip Menu |
Report information
Id: 125674
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

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



Date: Fri, 24 Jul 2015 15:13:32 +0300
Subject: LTA error message prints wrong eject position: if True if { };
To: rakudobug [...] perl.org
From: Alex Jakimenko <alex.jakimenko [...] gmail.com>
Download (untitled) / with headers
text/plain 628b
Code:
if True if { };

===SORRY!=== Error while compiling ./test.pl
Missing block
at ./test.pl:3
------> if True if ⏏{ };

Clearly the block is there. It seems like it expects a block before the second "if", but the cursor is placed incorrectly. STD gets it right:

15:03:25<jnthn> std: if True if { };
15:03:26<camelia> std 28329a7: OUTPUT«===SORRY!===␤Missing block at
          /tmp/XbS0PJUJZo line 1:␤------> if True ⏏if { };␤Parse
          failed␤FAILED 00:00 135m␤»

Similar problem with "unless", "while" and maybe some others.

Tiny IRC discussion: http://irclog.perlgeek.de/perl6/2015-07-24#i_10947603
This one is a bit harder than it seems.

So here is what throws: https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L315

However, the cursor has wrong position for some reason. Looking at the lines above, it may seem that doing this:

self.'!cursor_pos'($pos);

should fix
the problem… but it doesn't! $pos variable is set correctly, but !cursor_pos does absolutely nothing. In fact, you can try setting it to 0 or any other value, no effect whatsoever.

This suggests that the use of !cursor_pos in the same method does not work too. What is the right way to set the cursor?

And why does the cursor even have the incorrect value there?

As a bonus, this line seems to be unreachable:
self.missing("block (taken by some undeclared routine?)");

I tried various things but nothing can trigger it. I found (via google) some code snippets that used to result in this error message, but nowadays it simply says “Missing block”. I bisected that change to https://github.com/rakudo/rakudo/commit/8a70c921e98ed260d3198d81b81b0960c8daa83b


On 2015-07-24 05:13:59, alex.jakimenko@gmail.com wrote:
Show quoted text
> Code:
> if True if { };
>
> ===SORRY!=== Error while compiling ./test.pl
> Missing block
> at ./test.pl:3
> ------> if True if ⏏{ };
>
> Clearly the block is there. It seems like it expects a block before the
> second "if", but the cursor is placed incorrectly. STD gets it right:
>
> 15:03:25<jnthn> std: if True if { };
> 15:03:26<camelia> std 28329a7: OUTPUT«===SORRY!===␤Missing block at
> /tmp/XbS0PJUJZo line 1:␤------> if True ⏏if { };␤Parse
> failed␤FAILED 00:00 135m␤»
>
> Similar problem with "unless", "while" and maybe some others.
>
> Tiny IRC discussion: http://irclog.perlgeek.de/perl6/2015-07-24#i_10947603


Should be fixed in https://github.com/rakudo/rakudo/commit/5747bc7121

Testneeded. Slightly relevant tests here: https://github.com/perl6/roast/commit/34577134e0

On 2017-10-06 21:01:48, alex.jakimenko@gmail.com wrote:
Show quoted text
> This one is a bit harder than it seems.
>
> So here is what throws:
> https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L315
>
> However, the cursor has wrong position for some reason. Looking at the
> lines
> above, it may seem that doing this:
>
> self.'!cursor_pos'($pos);
>
> should fix the problem… but it doesn't! $pos variable is set
> correctly, but
> !cursor_pos does absolutely nothing. In fact, you can try setting it
> to 0 or
> any other value, no effect whatsoever.
>
> This suggests that the use of !cursor_pos in the same method does not
> work too.
> What is the right way to set the cursor?
>
> And why does the cursor even have the incorrect value there?
>
> As a bonus, this line seems to be unreachable:
> self.missing("block (taken by some undeclared routine?)");
>
> I tried various things but nothing can trigger it. I found (via
> google) some
> code snippets that used to result in this error message, but nowadays
> it simply
> says “Missing block”. I bisected that change to
> https://github.com/rakudo/rakudo/commit/8a70c921e98ed260d3198d81b81b0960c8daa83b
>
>
> On 2015-07-24 05:13:59, alex.jakimenko@gmail.com wrote:
> > Code:
> > if True if { };
> >
> > ===SORRY!=== Error while compiling ./test.pl
> > Missing block
> > at ./test.pl:3
> > ------> if True if ⏏{ };
> >
> > Clearly the block is there. It seems like it expects a block before
> > the
> > second "if", but the cursor is placed incorrectly. STD gets it right:
> >
> > 15:03:25<jnthn> std: if True if { };
> > 15:03:26<camelia> std 28329a7: OUTPUT«===SORRY!===␤Missing block at
> > /tmp/XbS0PJUJZo line 1:␤------> if True ⏏if { };␤Parse
> > failed␤FAILED 00:00 135m␤»
> >
> > Similar problem with "unless", "while" and maybe some others.
> >
> > Tiny IRC discussion: http://irclog.perlgeek.de/perl6/2015-07-
> > 24#i_10947603


Does not seem to be fixed at all. But I've added some todo-ed tests: https://github.com/perl6/roast/commit/f9f5034a1e66e068bfe21227e35f100f3c1e3fef

On 2017-10-07 13:43:30, alex.jakimenko@gmail.com wrote:
Show quoted text
> Should be fixed in https://github.com/rakudo/rakudo/commit/5747bc7121
>
> Testneeded. Slightly relevant tests here:
> https://github.com/perl6/roast/commit/34577134e0
>
> On 2017-10-06 21:01:48, alex.jakimenko@gmail.com wrote:
> > This one is a bit harder than it seems.
> >
> > So here is what throws:
> >
> https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L315
> >
> > However, the cursor has wrong position for some reason. Looking at
> > the
> > lines
> > above, it may seem that doing this:
> >
> > self.'!cursor_pos'($pos);
> >
> > should fix the problem… but it doesn't! $pos variable is set
> > correctly, but
> > !cursor_pos does absolutely nothing. In fact, you can try setting it
> > to 0 or
> > any other value, no effect whatsoever.
> >
> > This suggests that the use of !cursor_pos in the same method does not
> > work too.
> > What is the right way to set the cursor?
> >
> > And why does the cursor even have the incorrect value there?
> >
> > As a bonus, this line seems to be unreachable:
> > self.missing("block (taken by some undeclared routine?)");
> >
> > I tried various things but nothing can trigger it. I found (via
> > google) some
> > code snippets that used to result in this error message, but nowadays
> > it simply
> > says “Missing block”. I bisected that change to
> >
> https://github.com/rakudo/rakudo/commit/8a70c921e98ed260d3198d81b81b0960c8daa83b
> >
> >
> > On 2015-07-24 05:13:59, alex.jakimenko@gmail.com wrote:
> > > Code:
> > > if True if { };
> > >
> > > ===SORRY!=== Error while compiling ./test.pl
> > > Missing block
> > > at ./test.pl:3
> > > ------> if True if ⏏{ };
> > >
> > > Clearly the block is there. It seems like it expects a block before
> > > the
> > > second "if", but the cursor is placed incorrectly. STD gets it
> > > right:
> > >
> > > 15:03:25<jnthn> std: if True if { };
> > > 15:03:26<camelia> std 28329a7: OUTPUT«===SORRY!===␤Missing block at
> > > /tmp/XbS0PJUJZo line 1:␤------> if True ⏏if { };␤Parse
> > > failed␤FAILED 00:00 135m␤»
> > >
> > > Similar problem with "unless", "while" and maybe some others.
> > >
> > > Tiny IRC discussion: http://irclog.perlgeek.de/perl6/2015-07-
> > > 24#i_10947603




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