Skip to content

Commit 08cc098

Browse files
Protryonmichaelficarra
authored andcommitted
Fix extended syntax characters (#10)
Removes `\` from the extended syntax characters, which is not to spec.
1 parent 3a377d1 commit 08cc098

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/* eslint-disable no-use-before-define */
1818

1919
const syntaxCharacters = '^$\\.*+?()[]{}|'.split('');
20-
const extendedSyntaxCharacters = '^$\\.*+?()[|'.split('');
20+
const extendedSyntaxCharacters = '^$.*+?()[|'.split('');
2121

2222
const controlEscapeCharacters = 'fnrtv'.split('');
2323
const controlEscapeCharacterValues = { 'f': '\f'.charCodeAt(0), 'n': '\n'.charCodeAt(0), 'r': '\r'.charCodeAt(0), 't': '\t'.charCodeAt(0), 'v': '\v'.charCodeAt(0) };

test/literal-regexp-expression.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ suite('Parser', () => {
160160
/\k/
161161
/t{5/
162162
/[💩-💫]/u
163-
/[\u{1F4A9}-\u{1F4AB}]/u`);
163+
/[\u{1F4A9}-\u{1F4AB}]/u
164+
/\c/`);
164165
const regexToFail = preprocessRegexList(String.raw`/[/
165166
/(?<=t|v|X|.|$||)/
166167
/(?<!t|v|X|.|$||)/
@@ -199,7 +200,6 @@ suite('Parser', () => {
199200
/\c/u
200201
/\k<X>/u
201202
/(?<X>)/u
202-
/\c/
203203
/${'\\xZZ'}/u
204204
/\ud800${'\\uZZ'}/u
205205
/${'\\uZZ'}/u

0 commit comments

Comments
 (0)