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

Error when forgetting {} to interpolate range in regex #5204

Closed
p6rt opened this issue Mar 29, 2016 · 6 comments
Closed

Error when forgetting {} to interpolate range in regex #5204

p6rt opened this issue Mar 29, 2016 · 6 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Mar 29, 2016

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

Searchable as RT127801$

@p6rt
Copy link
Author

p6rt commented Mar 29, 2016

From trizenx@gmail.com

Seems like interpolated values for range boundaries are not parsed correctly.

To illustrate the issue, let's consider the following code​:

my $width = 5;
my $str = 'abcdefghijklmno';
say ($str ~~ /(. ** 1..$width)+/).values».Str;

The expected output should be​:

(abcde fghij klmno)

but currently we get a parse-time error​: Malformed Range

@p6rt
Copy link
Author

p6rt commented Mar 29, 2016

From @timo

If you want to use interpolated ranges, you'll have to use {1..$width}.

However, the error message is clearly wrong and could definitely be
changed to suggest that change. That's why I changed the title of the
bug (or at least tried to)

@p6rt
Copy link
Author

p6rt commented Mar 29, 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 rakudo 405519​:

<Zoffix> m​: my $width = 5; my $str = 'abcdefghijklmno'; say ($str ~~ /(. ** 1..$width)+/).values».Str;
<camelia> rakudo-moar 405519​: OUTPUT«===SORRY!=== Error while compiling <tmp>â�¤Malformed Rangeâ�¤at <tmp>​:1â�¤------> bcdefghijklmno'; say ($str ~~ /(. ** 1..â��$width)+/).values».Str;â�¤Â»

@p6rt
Copy link
Author

p6rt commented Jul 21, 2016

From @zoffixznet

LTA error fixed in rakudo/rakudo@713ad510d3

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

@p6rt
Copy link
Author

p6rt commented Jul 21, 2016

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

@p6rt p6rt closed this as completed Jul 21, 2016
@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant