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

LTA error message when quantifier follows nothing in Rakudo #2683

Closed
p6rt opened this issue Mar 24, 2012 · 10 comments
Closed

LTA error message when quantifier follows nothing in Rakudo #2683

p6rt opened this issue Mar 24, 2012 · 10 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 24, 2012

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

Searchable as RT111956$

@p6rt
Copy link
Author

p6rt commented Mar 24, 2012

From @masak

< masak> r​: my $foo = '*'; say "q*" ~~ / q <$foo> /
<p6eval> rakudo a4c78f​: OUTPUT«===SORRY!===␤Method 'rxtype' not found
for invocant of class 'Integer'␤»
<masak> innerestin'.
<sorear> n​: my $foo = '*'; say "q*" ~~ / q <$foo> /
<p6eval> niecza v15-5-g1252cdb​: OUTPUT«Unhandled exception​: Quantifier
quantifies nothing [...]
<masak> I prefer Niecza's error to Rakudo's.
<masak> r​: say '' ~~ / * /
<p6eval> rakudo a4c78f​: OUTPUT«===SORRY!===␤Method 'rxtype' not found
for invocant of class 'Integer'␤»
<masak> ah, there we go.
* masak submits LTA rakudobug

@p6rt
Copy link
Author

p6rt commented Mar 24, 2012

From @masak

On Sat Mar 24 10​:39​:53 2012, masak wrote​:

< masak> r​: my $foo = '*'; say "q*" ~~ / q <$foo> /
<p6eval> rakudo a4c78f​: OUTPUT«===SORRY!===␤Method 'rxtype' not found
for invocant of class 'Integer'␤»
<masak> innerestin'.
<sorear> n​: my $foo = '*'; say "q*" ~~ / q <$foo> /
<p6eval> niecza v15-5-g1252cdb​: OUTPUT«Unhandled exception​: Quantifier
quantifies nothing [...]
<masak> I prefer Niecza's error to Rakudo's.
<masak> r​: say '' ~~ / * /
<p6eval> rakudo a4c78f​: OUTPUT«===SORRY!===␤Method 'rxtype' not found
for invocant of class 'Integer'␤»
<masak> ah, there we go.
* masak submits LTA rakudobug

<moritz> r​: "" ~~ / * /
<p6eval> rakudo a4c78f​: OUTPUT«===SORRY!===␤Method 'rxtype' not found
for invocant of class 'Integer'␤»
<moritz> so, one needs ~~ *and* whitesapce to trigger it?
<moritz> r​: / * /
<p6eval> rakudo a4c78f​: OUTPUT«===SORRY!===␤Method 'rxtype' not found
for invocant of class 'Integer'␤»
<moritz> no, just whitespace
<moritz> so, probably a parsing bug
* masak updates the RT ticket

@p6rt
Copy link
Author

p6rt commented Mar 24, 2012

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

@p6rt
Copy link
Author

p6rt commented May 27, 2012

From @masak

<colomon> r​: / a+ + /
<p6eval> rakudo 300327​: OUTPUT«===SORRY!===␤Method 'rxtype' not found
for invocant of class 'Integer'␤»
<colomon> std​: / a+ + /
<p6eval> std 8632387​: OUTPUT«===SORRY!===␤Quantifier quantifies
nothing at /tmp/pMpmohyp_Z line 1​:␤------> / a+ +⏏ /␤Check
failed␤FAILED 00​:00 41m␤»
<jnthn> STD's output is the one I expected.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented May 9, 2013

From @masak

<[Coke]> hurm. this line​: $text ~~ /^( +)/; -- dies with Method
'rxtype' not found for invocant of class 'Integer'
<[Coke]> (compile time, even.)
<[Coke]> it's the regex - it was ^(\s+), and I wrongly changed it to
^( +) instead of ^ (' '+) -- weird error, though.
<PerlJam> [Coke]​: Well, at least it lets you know that there's
something wrong with the regex :)
<PerlJam> [Coke]​: yeah, the message is severely LTA
<[Coke]> Yah. just a better error message would help. (especially with
a line number.)
<Ayiko> /(+)/ gives the right error
<[Coke]> of course I changed 8 other things at the same time, so it
took me a minute to realize. ;)
<masak> [Coke]​: are you submitting that LTA bug, or should I?
[...]
<[Coke]> masak​: i didn't submit that bug and am just getting back.
<[Coke]> masak​: por favor.
* masak submits [Coke]'s rakudobug
<[Coke]> masak​: ... looks like it was already fixed in an nqp branch
<masak> [Coke]​: I included that fact in the RT ticket.

@p6rt
Copy link
Author

p6rt commented Oct 5, 2014

From @usev6

The error message with nom is now "Quantifier quantifies nothing"​:

/ * /
===SORRY!=== Error while compiling <unknown file>
Quantifier quantifies nothing
at <unknown file>​:1
------> / *⏏ /
  expecting any of​:
  statement list
  prefix or term
  prefix or meta-prefix

/ a+ + /
===SORRY!=== Error while compiling <unknown file>
Quantifier quantifies nothing
at <unknown file>​:1
------> / a+ +⏏ /
  expecting any of​:
  statement list
  prefix or term
  prefix or meta-prefix

I'll add a typed exception and a test.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 5, 2014

From @usev6

The error message with nom is now "Quantifier quantifies nothing"​:

/ * /
===SORRY!=== Error while compiling <unknown file>
Quantifier quantifies nothing
at <unknown file>​:1
------> / *⏏ /
  expecting any of​:
  statement list
  prefix or term
  prefix or meta-prefix

/ a+ + /
===SORRY!=== Error while compiling <unknown file>
Quantifier quantifies nothing
at <unknown file>​:1
------> / a+ +⏏ /
  expecting any of​:
  statement list
  prefix or term
  prefix or meta-prefix

I'll add a typed exception and a test.

@p6rt
Copy link
Author

p6rt commented Nov 8, 2014

From @usev6

On Sun Oct 05 14​:20​:32 2014, bartolin@​gmx.de wrote​:

The error message with nom is now "Quantifier quantifies nothing"​:

/ * /
===SORRY!=== Error while compiling <unknown file>
Quantifier quantifies nothing
at <unknown file>​:1
------> / *⏏ /
expecting any of​:
statement list
prefix or term
prefix or meta-prefix

/ a+ + /
===SORRY!=== Error while compiling <unknown file>
Quantifier quantifies nothing
at <unknown file>​:1
------> / a+ +⏏ /
expecting any of​:
statement list
prefix or term
prefix or meta-prefix

I'll add a typed exception and a test.

I added a typed exception X​::Syntax​::Regex​::SolitaryQuantifier​:

* Raku/nqp#197

* rakudo/rakudo#328 and rakudo/rakudo#319

Also I added a test (fudged todo) to S05-metasyntax/repeat.t with commit Raku/roast@496aa2ffa9

With the next bump of NQP_REVISION the test should start to pass -- then I'll close the ticket.

@p6rt
Copy link
Author

p6rt commented Nov 9, 2014

From @usev6

The tests are passing now.

@p6rt
Copy link
Author

p6rt commented Nov 9, 2014

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

@p6rt p6rt closed this as completed Nov 9, 2014
@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