Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rakudo can't parse lexical subrule calls with arguments in regexes. #2055

Closed
p6rt opened this issue Aug 11, 2010 · 5 comments
Closed

Rakudo can't parse lexical subrule calls with arguments in regexes. #2055

p6rt opened this issue Aug 11, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Aug 11, 2010

Migrated from rt.perl.org#77152 (status was 'resolved')

Searchable as RT77152$

@p6rt
Copy link
Author

p6rt commented Aug 11, 2010

From ekiru.0@gmail.com

Here's a relevant irclog​:

[8​:58pm] pmichaud​: rakudo​: my regex foo($s) { $s }; say 'a' ~~ / <&foo('a')> /
[8​:58pm] p6eval​: rakudo fcf4f3​: OUTPUT«===SORRY!===␤regex assertion
not terminated by angle bracket at line 22, near "('a')> /"␤»
[8​:58pm] pmichaud​: rakudo​: my regex foo($s) { $s }; say 'a' ~~ / <foo('a')> /
[8​:59pm] p6eval​: rakudo fcf4f3​: OUTPUT«Method 'foo' not found for
invocant of class 'Cursor'␤ in <anon> at line 22​:/tmp/1_T4OrYTpn␤ in
'Cool​::match' at line 2406​:CORE.setting␤ in 'Regex​::ACCEPTS' at line
5676​:CORE.setting␤ in main program body at line 22​:/tmp/1_T4OrYTpn␤»
[8​:59pm] pmichaud​: a-ha
[8​:59pm] pmichaud​: it doesn't know how to parse circumfixes on variables
[8​:59pm] pmichaud​: a-ha
[8​:59pm] pmichaud​: because STD.pm parses an entire expression there
[8​:59pm] pmichaud​: we might be able to handle that.
[9​:00pm] pmichaud​: please file rakudobug if you get a chance.

This also occurs with <&foo​: 'a'>.

For either "my regex foo($s) { $s }; say 'a' ~~ / <&foo('a')> /;" or
"my regex foo($s) { $s }; say 'a' ~~ / <&foo​: 'a'> /;", the output
should be 'a'.

--
Tyler Curtis

@p6rt
Copy link
Author

p6rt commented Aug 18, 2010

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 14, 2014

From @ShimmerFairy

By sheer serendipity, these two bugs were rediscovered just today (see http://irclog.perlgeek.de/perl6/2014-03-13#i_8432837 and onwards). The <foo(arg)> form is fixed, while the <&foo(arg)> currently fails with this message​:

<lue> m​: my regex foo($s) { $s }; say 'a' ~~ / <&foo('a')> /
<camelia> rakudo-moar 20193f​: OUTPUT«===SORRY!=== Error while compiling /tmp/ovRhg7YJHv␤Unable to parse expression in metachar​:sym<assert>; couldn't find final '>' ␤at /tmp/ovRhg7YJHv​:1␤------> regex foo($s) { $s }; say 'a' ~~ / <&foo⏏('a')> /␤»

@p6rt
Copy link
Author

p6rt commented Apr 28, 2015

From @jnthn

On Thu Mar 13 19​:56​:42 2014, lue wrote​:

By sheer serendipity, these two bugs were rediscovered just today (see
http://irclog.perlgeek.de/perl6/2014-03-13#i_8432837 and onwards). The
<foo(arg)> form is fixed, while the <&foo(arg)> currently fails with
this message​:

<lue> m​: my regex foo($s) { $s }; say 'a' ~~ / <&foo('a')> /
<camelia> rakudo-moar 20193f​: OUTPUT«===SORRY!=== Error while
compiling /tmp/ovRhg7YJHv␤Unable to parse expression in
metachar​:sym<assert>; couldn't find final '>' ␤at
/tmp/ovRhg7YJHv​:1␤------> regex foo($s) { $s }; say 'a' ~~ /
<&foo⏏('a')> /␤»

This is now also fixed, along with the <&foo​: ...> form. Both have tests in S05-interpolation/lexicals.t.

@p6rt
Copy link
Author

p6rt commented Apr 28, 2015

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant