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

Parsing bug in Rakudo when the match variable and a postfix is followed by a double minus #5174

Open
p6rt opened this issue Mar 13, 2016 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Mar 13, 2016

Migrated from rt.perl.org#127701 (status was 'open')

Searchable as RT127701$

@p6rt
Copy link
Author

p6rt commented Mar 13, 2016

From @moritz

<moritz> m​: '5x3' ~~ /(.)x(.)/ and say "$/[0]--$/[1]"
<camelia> rakudo-moar 374fdd​: OUTPUT«5x3[0]--3␤»
<timotimo> the AST it outputs is just concatenating the value of $/ with
"[0]--" and then the value of $/[1]
<moritz> yes, that looks like a bug
<timotimo> i'd say this is a bug. it should see that the [0] is a
successful postcircumfix parse, and ignore the -- after it
<timotimo> bazzaar​: so, thank you for finding this bug :)
<bazzaar> yes that's the kind of result I got, $0--$1 works fine

Some golfing​:

<moritz> m​: '5x3' ~~ /(.)x(.)/ and say "$/[0]--"
<camelia> rakudo-moar 374fdd​: OUTPUT«5x3[0]--␤»
<moritz> m​: '5x3' ~~ /(.)x(.)/ and say "$/[0]-"
<camelia> rakudo-moar 374fdd​: OUTPUT«5-␤»

@p6rt
Copy link
Author

p6rt commented Mar 13, 2016

From @timo

Defining new postfix​:<foo> will make "foo" after [0] cause the [0] to be
output verbatim rather than having [0] be interpreted as the
postcircumfix on $/.

@p6rt
Copy link
Author

p6rt commented Mar 13, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 10, 2016

From @zoffixznet

Still present in today' rakudo 2ad323​:

<Zoffix> m​: '5x3' ~~ /(.)x(.)/ and say "$/[0]--"
<camelia> rakudo-moar 2ad323​: OUTPUT«5x3[0]--␤»
<Zoffix> m​: '5x3' ~~ /(.)x(.)/ and say "$/[0]-"
<camelia> rakudo-moar 2ad323​: OUTPUT«5-␤»
<Zoffix> m​: '5x3' ~~ /(.)x(.)/ and say "$/[0]"
<camelia> rakudo-moar 2ad323​: OUTPUT«5␤»
<Zoffix> m​: '5x3' ~~ /(.)x(.)/ and say "$/"
<camelia> rakudo-moar 2ad323​: OUTPUT«5x3␤»

@p6rt
Copy link
Author

p6rt commented Jul 21, 2016

From @zoffixznet

♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁

TODO-fudged tests added in Raku/roast@e25ff99452

🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥

--
Cheers,
ZZ | https://twitter.com/zoffix

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