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

Misleading error in tr/// when including a # character #2118

Open
jmaslak opened this Issue Jul 22, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@jmaslak
Contributor

jmaslak commented Jul 22, 2018

The Problem

Misleading error message for # in a tr/TR.

The error message indicates "Please backslash # for literal char or put whitespace in front for comment".

However, adding a backslash just generates the same error message.

Expected Behavior

I'm not entirely sure what the proper behavior of a backslash in a TR should be. When working on #2117, I was trying to generate errors based on unrecognized backslash sequences to test the PR, but was not able to trigger that condition.

My expectations (which may be wrong) would be that either the backslash in front of # should work and quiet this error or the error message should be changed.

Actual Behavior

Without backslash:

[1] red:rakudo$ perl6 -e '1 ~~ TR/#//'
===SORRY!=== Error while compiling -e
Please backslash # for literal char or put whitespace in front for comment
at -e:1
------> 1 ~~ TR/#⏏//

With backslash:

[1] red:rakudo$ perl6 -e '1 ~~ TR/\#//'
===SORRY!=== Error while compiling -e
Please backslash # for literal char or put whitespace in front for comment
at -e:1
------> 1 ~~ TR/\#⏏//

Steps to Reproduce

See above.

Environment

  • Operating system: Ubuntu 18.04
  • Compiler version (perl6 -v): HEAD & 18.06
@zoffixznet

This comment has been minimized.

Show comment
Hide comment
@zoffixznet

zoffixznet Jul 22, 2018

Contributor

Related ticket: #1324

Contributor

zoffixznet commented Jul 22, 2018

Related ticket: #1324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment