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

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

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



Subject: [BUG] capture variable does not parse for building a pair of the form :$<a>
Date: Thu, 5 Aug 2010 03:02:59 +0200
To: bug <rakudobug [...] perl.org>
From: Stéphane Payrard <cognominal [...] gmail.com>
Download (untitled) / with headers
text/plain 460b
Test program below gives ===SORRY!=== Unable to parse blockoid, couldn't find final '}' at line 7 grammar A { token TOP { <a> }; token a { a } }; class A::A { method TOP($/) { say :$<a> } }; A.parse('a', :actions(A::A)); Note: the specs don't mention that form for capture variables, neither the form for context variable. The latter works as expected though. $ perl6 Show quoted text
> my $*a = 1; say :$*a.perl
"a" => 1 Show quoted text
>
-- cognominal stef
Download (untitled) / with headers
text/plain 591b
cognominal (>): Show quoted text
> Test program below gives > ===SORRY!=== > Unable to parse blockoid, couldn't find final '}' at line 7 > > > grammar A { > token TOP { <a> }; > token a { a } > }; > > class A::A { > method TOP($/) { say :$<a> } > }; > > A.parse('a', :actions(A::A)); > > > Note: the specs don't mention that form for capture variables, neither > the form for context variable. > The latter works as expected though. > > > $ perl6
> > my $*a = 1; say :$*a.perl
> "a" => 1
Yes, it should work: <masak> std: :$<a> <p6eval> std 31912: OUTPUT«ok 00:01 111m␤»
Download (untitled) / with headers
text/plain 899b
On Sat Aug 07 22:42:52 2010, masak wrote: Show quoted text
> cognominal (>):
> > Test program below gives > > ===SORRY!=== > > Unable to parse blockoid, couldn't find final '}' at line 7 > > > > > > grammar A { > > token TOP { <a> }; > > token a { a } > > }; > > > > class A::A { > > method TOP($/) { say :$<a> } > > }; > > > > A.parse('a', :actions(A::A)); > > > > > > Note: the specs don't mention that form for capture variables,
neither Show quoted text
> > the form for context variable. > > The latter works as expected though. > > > > > > $ perl6
> > > my $*a = 1; say :$*a.perl
> > "a" => 1
> > Yes, it should work: > > <masak> std: :$<a> > <p6eval> std 31912: OUTPUT«ok 00:01 111m␤»
Implemented; works now: Show quoted text
> 'abc' ~~ /a $<a>=[\w+]/; say :$<a>.perl
"a" => Match.new(orig => "abc", from => 1, to => 3, ast => Any, list => ().list, hash => EnumMap.new()) Tagging testneeded. /jnthn


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