# New Ticket Created by  Brandon Allbery 
# Please include the string:  [perl #132035]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=132035 >


Seen in IRC:

[05 17:51:12] <Zoffix> m: grammar { token TOP { :my $*v = 42; <foo> };
token foo { {dd $*v } <bar> }; token bar { :temp $*val = 100; <bez> };
token bez { {dd $*val } .+ } }.parse: "foo"
[05 17:51:12] <camelia> rakudo-moar c39db8: OUTPUT: «Int $*v = 42␤
[05 17:51:12]  Can only use 'temp' on a container␤
[05 17:51:12]    in regex bar at <tmp> line 1␤
[05 17:51:12]    in regex foo at <tmp> line 1␤
[05 17:51:12]    in regex TOP at <tmp> line 1␤
[05 17:51:12]    in block <unit> at <tmp> line 1␤
[05 17:51:12]  ␤
[05 17:51:12]  »
[05 17:51:20] <Zoffix> ... and I'm using it on... ?
[05 17:51:45] <Zoffix> piojo2: well, that would've been ^ a better
solution, but apparently that's also broken :P
[05 17:52:00] <Zoffix> Oh, wait
[05 17:52:16] <Zoffix> m: grammar { token TOP { :my $*v = 42; <foo> };
token foo { {dd $*v } <bar> }; token bar { :temp $*v = 100; <bez> }; token
bez { {dd $*v } .+ } }.parse: "foo"
[05 17:52:16] <camelia> rakudo-moar c39db8: OUTPUT: «Int $*v = 42␤
[05 17:52:16]  Int $*v = 100␤
[05 17:52:16]  »
[05 17:52:24] <Zoffix> It works if you name your variables right :P
[05 17:53:39] <geekosaur> that error seems a trifle LTA

Apparently it's reacting to the default value being a Failure. Which is
fine as to mechanism, but it'd be better for it to note an uninitialized
variable and still better yet to recognize that it could be a typo.

(Yes, I recognize this could be tricky.)

-- 
brandon s allbery kf8nh                               sine nomine associates
allber...@gmail.com                                  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

Reply via email to