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 message for negative range quantifier endpoint not precise enough #2087

Closed
p6rt opened this issue Aug 23, 2010 · 8 comments
Closed

error message for negative range quantifier endpoint not precise enough #2087

p6rt opened this issue Aug 23, 2010 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Aug 23, 2010

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

Searchable as RT77380$

@p6rt
Copy link
Author

p6rt commented Aug 23, 2010

From @bbkr

This code​:
"" ~~ /m ** 1..-1 /

Gives following message​:
"Only integers or '*' allowed as range quantifier endpoint"

I think that error message should say "positive integers" or "unsigned
integers" because -1 IS also an integer.

I don't know what STD says about it, because eval on IRC seems to be currently
down

@p6rt
Copy link
Author

p6rt commented Aug 23, 2010

From @bbkr

[18​:35] <TimToady> std​: say "" ~~ /m ** 1..-1 /
[18​:35] <p6eval> std 32088​:
OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m�Malformed range at /tmp/NlvQf0HNFI
line 1​:â�¤------> �[32msay "" ~~ /m ** 1..�[33mâ���[31m-1 /�[0mâ�¤
expecting quantifierâ�¤Parse failedâ�¤FAILED 00​:01 119mâ�¤Â»

@p6rt
Copy link
Author

p6rt commented Aug 23, 2010

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

@p6rt
Copy link
Author

p6rt commented May 11, 2013

From @coke

On Mon Aug 23 09​:32​:08 2010, pawel.pabian@​implix.com wrote​:

This code​:
"" ~~ /m ** 1..-1 /

Gives following message​:
"Only integers or '*' allowed as range quantifier endpoint"

I think that error message should say "positive integers" or "unsigned
integers" because -1 IS also an integer.

I don't know what STD says about it, because eval on IRC seems to be
currently
down

01​:40 <[Coke]> r​: "" ~~ /m ** 1..-1 /
01​:40 <camelia> rakudo bfd850​: OUTPUT«===SORRY!===â�¤Negative numbers are not
  allowed as range quantifier endpointâ�¤at
  /tmp/QI9W2dDDrG​:1â�¤------> "" ~~ /m ** 1..-1â�� /â�¤Â»
01​:41 <[Coke]> std​: "" ~~ /m ** 1..-1 /
01​:41 <camelia> std b33d8e0​: OUTPUT«===SORRY!===â�¤Malformed range at
  /tmp/bftAQl82Sb line 1​:â�¤------> "" ~~ /m ** 1..â��-1 /â�¤
  expecting quantifierâ�¤Parse failedâ�¤FAILED 00​:01 43mâ�¤Â»

I'd say this meets the criteria of the original bug report. Closable with tests, I think.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Aug 11, 2014

From @peschwa

Am Fr 10. Mai 2013, 22​:42​:09, coke schrieb​:

On Mon Aug 23 09​:32​:08 2010, pawel.pabian@​implix.com wrote​:

This code​:
"" ~~ /m ** 1..-1 /

Gives following message​:
"Only integers or '*' allowed as range quantifier endpoint"

I think that error message should say "positive integers" or
"unsigned
integers" because -1 IS also an integer.

I don't know what STD says about it, because eval on IRC seems to be
currently
down

01​:40 <[Coke]> r​: "" ~~ /m ** 1..-1 /
01​:40 <camelia> rakudo bfd850​: OUTPUT«===SORRY!===â�¤Negative numbers
are not
allowed as range quantifier endpoint�at
/tmp/QI9W2dDDrG​:1â�¤------> "" ~~ /m ** 1..-1â�� /â�¤Â»
01​:41 <[Coke]> std​: "" ~~ /m ** 1..-1 /
01​:41 <camelia> std b33d8e0​: OUTPUT«===SORRY!===â�¤Malformed range at
/tmp/bftAQl82Sb line 1​:â�¤------> "" ~~ /m ** 1..â��-1 /â�¤
expecting quantifierâ�¤Parse failedâ�¤FAILED 00​:01 43mâ�¤Â»

I'd say this meets the criteria of the original bug report. Closable
with tests, I think.

A typed exception has been added (X​::Syntax​::Regex​::MalformedRange) and is tested for in roast with commit ca327a9c.

@p6rt
Copy link
Author

p6rt commented Dec 19, 2014

From @usev6

Since the test in S32-exceptions/misc.t passes on all backends, I'm closing this ticket.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Dec 19, 2014

From @usev6

Since the test in S32-exceptions/misc.t passes on all backends, I'm closing this ticket.

@p6rt
Copy link
Author

p6rt commented Dec 19, 2014

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

@p6rt p6rt closed this as completed Dec 19, 2014
@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant