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 message on unescaped "-" in substitution #2042

Closed
p6rt opened this issue Aug 9, 2010 · 6 comments
Closed

LTA message on unescaped "-" in substitution #2042

p6rt opened this issue Aug 9, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Aug 9, 2010

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

Searchable as RT77110$

@p6rt
Copy link
Author

p6rt commented Aug 9, 2010

From @bbkr

$ perl6 -e '$_ = "0"; s/-/1/;'
Could not find sub &s
  in main program body at line 1

same LTA message is on STD​:

[16​:08] <bbkr> std​: $_ = "0"; s/-/1/;
[16​:08] <p6eval> std 31912​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0mâ�¤Undeclared
routine​:â�¤ 's' used at line 1â�¤Check failedâ�¤FAILED 00​:01 116mâ�¤Â»
[16​:08] <bbkr> who can explain this one?
[16​:08] <moritz_> you need to escape - in a regex
[16​:09] <moritz_> and empty regex is disallowed
[16​:09] <moritz_> and std used to give good error messages for both, but it's
borked now
[16​:09] <bbkr> moritz_​: I know about escaping. but error is LTA in this case.
[16​:10] <moritz_> bbkr​: not only LTA. It sucks.
[16​:10] <moritz_> TimToady​: (see above)

@p6rt
Copy link
Author

p6rt commented Feb 1, 2012

From @coke

On Mon Aug 09 07​:19​:30 2010, pawel.pabian@​implix.com wrote​:

$ perl6 -e '$_ = "0"; s/-/1/;'
Could not find sub &s
in main program body at line 1

same LTA message is on STD​:

[16​:08] <bbkr> std​: $_ = "0"; s/-/1/;
[16​:08] <p6eval> std 31912​:
OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m�Undeclared
routine​:â�¤ 's' used at line 1â�¤Check failedâ�¤FAILED 00​:01 116mâ�¤Â»
[16​:08] <bbkr> who can explain this one?
[16​:08] <moritz_> you need to escape - in a regex
[16​:09] <moritz_> and empty regex is disallowed
[16​:09] <moritz_> and std used to give good error messages for both,
but it's
borked now
[16​:09] <bbkr> moritz_​: I know about escaping. but error is LTA in
this case.
[16​:10] <moritz_> bbkr​: not only LTA. It sucks.
[16​:10] <moritz_> TimToady​: (see above)

This now gives the much awesomer​:

09​:16 < [Coke]> rakudo​: $_ = "0"; s/-/1/; # RT #​77110
09​:16 <+p6eval> rakudo ce5cca​: OUTPUT«===SORRY!===â�¤Unrecognized regex
  metacharacter (must be quoted to match literally) at
line 1,
  near "/1/; # RT "â�¤Â»

Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Feb 1, 2012

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

@p6rt
Copy link
Author

p6rt commented Jul 15, 2012

From @bbkr

On latest rakudo it even tells which metacharacter is it​:

r$ ./perl6 -e '$_ = "0"; s/-/1/;'
===SORRY!===
Unrecognized regex metacharacter - (must be quoted to match literally) at line 2, near "/1/;"

Taking for tests.

@p6rt
Copy link
Author

p6rt commented Jul 15, 2012

From @bbkr

Test in

Raku/roast@6dff118dd7

@p6rt
Copy link
Author

p6rt commented Jul 15, 2012

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

@p6rt p6rt closed this as completed Jul 15, 2012
@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