develooper Front page | perl.perl6.compiler | Postings from April 2012

[perl #112578] [BUG] Closing brace + newlines + infix op wrongly parsed by Rakudo

From:
Carl Mäsak
Date:
April 22, 2012 03:02
Subject:
[perl #112578] [BUG] Closing brace + newlines + infix op wrongly parsed by Rakudo
Message ID:
rt-3.6.HEAD-4610-1335088937-469.112578-82-0@perl.org
# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #112578]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=112578 >


<masak> r: sub foo($x) {}␤&foo.wrap: sub ($x) {}
<p6eval> rakudo a8f855: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling
'foo' will never work with no arguments (line 2)␤    Expected: :($x)␤»
* masak submits rakudobug

jnthn++ concludes that the '&foo.wrap' is read as infix:<&> +
'foo().wrap', leading to the above error.

In fact, *any* infix operator in place of '&' parses in this way in
Rakudo currently.

jnthn++ also concludes that this is due to the expression parser
gobbling up too much whitespace after the '}'.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About