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

Somewhat misleading escape tokens in String.raw tagged templates #1039

Open
Vap0r1ze opened this issue Jul 12, 2024 · 0 comments
Open

Somewhat misleading escape tokens in String.raw tagged templates #1039

Vap0r1ze opened this issue Jul 12, 2024 · 0 comments

Comments

@Vap0r1ze
Copy link

JavaScript and TypeScript Nightly version:

Code

// Please include a code snippet that demonstrates the issue
String.raw`--some-flag=C:\Some\Windows\Path` // It looks like the first letter of each dir is being escaped
String.raw`"This is\nJSON text\u2757"` // It looks like '\n' is being escaped
Example of how it looks in VSCode

image

Since String.raw is an EcmaScript standard, it's probably ideal that the grammar shows those string tokens without any escape tokens.

Important to note that backslashes shouldn't be ignored in the pattern, for example:

//        ╭─ Template string opener
//        ┴
String.raw`\`;
//         ─┬─
//          ╰─ Unclosed template string content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant