Skip to content

Conversation

kevinoid
Copy link

The \\c + ASCII letter escape sequence is not specified as part of the EscapeSequence production in the grammar for strings. It behaves like any other unspecified character by ignoring the backslash. The escape sequence is only specified as part of the CharacterEscape production in the grammar for RegExp patterns, where it matches a character with the letter's codepoint mod 32 (which is the same for uppercase and lowercase ASCII letters).

This PR updates the syntax to highlight both uppercase and lowercase letters in RegExp and neither in strings.

Thanks for considering,
Kevin

The `\\c + ASCII letter` escape sequence is not specified as part of the
[EscapeSequence] production in the grammar for strings.  It behaves like
any other unspecified character by ignoring the backslash.  The escape
sequence is only specified as part of the [CharacterEscape] production
in the grammar for RegExp patterns, where it matches a character with
the letter's codepoint mod 32 (which is the same for uppercase and
lowercase ASCII letters).

Update the syntax to highlight both uppercase and lowercase letters in
RegExp and neither in strings.

[CharacterEscape]: https://www.ecma-international.org/ecma-262/#prod-CharacterEscape
[EscapeSequence]: https://www.ecma-international.org/ecma-262/#prod-EscapeSequence

Signed-off-by: Kevin Locke <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant