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

Definition of zero-length postfix operator wrongly allowed in Rakudo #2871

Open
p6rt opened this issue Aug 23, 2012 · 5 comments
Open

Definition of zero-length postfix operator wrongly allowed in Rakudo #2871

p6rt opened this issue Aug 23, 2012 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 23, 2012

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

Searchable as RT114554$

@p6rt
Copy link
Author

p6rt commented Aug 23, 2012

From @masak

<timotimo> r​: sub postfix​:{}($a) { say "$a bracey brace" }; 42{}
<p6eval> rakudo befe7c​: OUTPUT«(timeout)»
<timotimo> whoops?
<moritz> r​: sub postfix​:<{}>($a) { say "$a bracey brace" }; 42{}
<p6eval> rakudo befe7c​: OUTPUT«42 bracey brace␤»
<timotimo> interesting. how did i trigger a loop there?
<moritz> timotimo​: it created a zero-width match, which was then
quantified in the grammar
<timotimo> aaaah
<moritz> timotimo​: so it matched the empty postfix all over again
<timotimo> of course.
<moritz> wouldn't that be a cute way to write a debugger?
<moritz> write an empty-string postfix
<moritz> that automatigacally gets inserted everywhere :-)
<timotimo> heh heh
* masak submits rakudobug
<masak> shouldn't be allowed to write empty postfixes, methinks

@p6rt
Copy link
Author

p6rt commented Oct 11, 2013

From @Mouq

Behavior change​:
21​:06 <Mouq> r​: sub postfix​:{}($a) { say "$a bracey brace" }; 42{}
21​:07 <camelia> rakudo 50cecf​: OUTPUT«===SORRY!===␤No such method 'ast'
for invocant of type 'NQPMu'␤»

On Thu Aug 23 10​:05​:14 2012, masak wrote​:

<timotimo> r​: sub postfix​:{}($a) { say "$a bracey brace" }; 42{}
<p6eval> rakudo befe7c​: OUTPUT«(timeout)»
<timotimo> whoops?
<moritz> r​: sub postfix​:<{}>($a) { say "$a bracey brace" }; 42{}
<p6eval> rakudo befe7c​: OUTPUT«42 bracey brace␤»
<timotimo> interesting. how did i trigger a loop there?
<moritz> timotimo​: it created a zero-width match, which was then
quantified in the grammar
<timotimo> aaaah
<moritz> timotimo​: so it matched the empty postfix all over again
<timotimo> of course.
<moritz> wouldn't that be a cute way to write a debugger?
<moritz> write an empty-string postfix
<moritz> that automatigacally gets inserted everywhere :-)
<timotimo> heh heh
* masak submits rakudobug
<masak> shouldn't be allowed to write empty postfixes, methinks

@p6rt
Copy link
Author

p6rt commented Oct 11, 2013

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

@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

From @diakopter

new behavior​:

13​:30 <diakopter> m​: sub postfix​:{}($a) { say "$a bracey brace" }; 42{}
13​:30 <camelia> rakudo-moar 61d231​: OUTPUT«===SORRY!===␤Internal error​: find_var_decl could not find $_␤»

@p6rt
Copy link
Author

p6rt commented Mar 9, 2018

From @zoffixznet

On Thu, 07 Apr 2016 10​:31​:20 -0700, diakopter wrote​:

new behavior​:

13​:30 <diakopter> m​: sub postfix​:{}($a) { say "$a bracey brace" };
42{}
13​:30 <camelia> rakudo-moar 61d231​: OUTPUT«===SORRY!===␤Internal
error​: find_var_decl could not find $_␤»

Couple more glitches in the same area​:

14​:59 Zoffix m​: my $z​:{​:42foo}
14​:59 camelia rakudo-moar 26522e8ac​: OUTPUT​: «5===SORRY!5=== Error while compiling <tmp>␤You can't adverb $z␤at <tmp>​:1␤------> 3my $z​:{​:42foo}7⏏5<EOL>␤»
14​:59 Zoffix m​: my \z​:{​:42foo}
14​:59 camelia rakudo-moar 26522e8ac​: OUTPUT​: «===SORRY!===␤Cannot find method 'ast' on object of type NQPMu␤»

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant