@eslint-community/regexpp 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -125,105 +125,105 @@ function isValidLoneUnicodeProperty(version, value) {
125
125
  (version >= 2021 && binPropertySets.es2021.has(value)));
126
126
  }
127
127
 
128
- const Backspace = 0x08;
129
- const CharacterTabulation = 0x09;
130
- const LineFeed = 0x0a;
131
- const LineTabulation = 0x0b;
132
- const FormFeed = 0x0c;
133
- const CarriageReturn = 0x0d;
134
- const ExclamationMark = 0x21;
135
- const DollarSign = 0x24;
136
- const LeftParenthesis = 0x28;
137
- const RightParenthesis = 0x29;
138
- const Asterisk = 0x2a;
139
- const PlusSign = 0x2b;
140
- const Comma = 0x2c;
141
- const HyphenMinus = 0x2d;
142
- const FullStop = 0x2e;
143
- const Solidus = 0x2f;
144
- const DigitZero = 0x30;
145
- const DigitOne = 0x31;
146
- const DigitSeven = 0x37;
147
- const DigitNine = 0x39;
148
- const Colon = 0x3a;
149
- const LessThanSign = 0x3c;
150
- const EqualsSign = 0x3d;
151
- const GreaterThanSign = 0x3e;
152
- const QuestionMark = 0x3f;
153
- const LatinCapitalLetterA = 0x41;
154
- const LatinCapitalLetterB = 0x42;
155
- const LatinCapitalLetterD = 0x44;
156
- const LatinCapitalLetterF = 0x46;
157
- const LatinCapitalLetterP = 0x50;
158
- const LatinCapitalLetterS = 0x53;
159
- const LatinCapitalLetterW = 0x57;
160
- const LatinCapitalLetterZ = 0x5a;
161
- const LowLine = 0x5f;
162
- const LatinSmallLetterA = 0x61;
163
- const LatinSmallLetterB = 0x62;
164
- const LatinSmallLetterC = 0x63;
165
- const LatinSmallLetterD = 0x64;
166
- const LatinSmallLetterF = 0x66;
167
- const LatinSmallLetterG = 0x67;
168
- const LatinSmallLetterI = 0x69;
169
- const LatinSmallLetterK = 0x6b;
170
- const LatinSmallLetterM = 0x6d;
171
- const LatinSmallLetterN = 0x6e;
172
- const LatinSmallLetterP = 0x70;
173
- const LatinSmallLetterR = 0x72;
174
- const LatinSmallLetterS = 0x73;
175
- const LatinSmallLetterT = 0x74;
176
- const LatinSmallLetterU = 0x75;
177
- const LatinSmallLetterV = 0x76;
178
- const LatinSmallLetterW = 0x77;
179
- const LatinSmallLetterX = 0x78;
180
- const LatinSmallLetterY = 0x79;
181
- const LatinSmallLetterZ = 0x7a;
182
- const LeftSquareBracket = 0x5b;
183
- const ReverseSolidus = 0x5c;
184
- const RightSquareBracket = 0x5d;
185
- const CircumflexAccent = 0x5e;
186
- const LeftCurlyBracket = 0x7b;
187
- const VerticalLine = 0x7c;
188
- const RightCurlyBracket = 0x7d;
189
- const ZeroWidthNonJoiner = 0x200c;
190
- const ZeroWidthJoiner = 0x200d;
191
- const LineSeparator = 0x2028;
192
- const ParagraphSeparator = 0x2029;
193
- const MinCodePoint = 0x00;
194
- const MaxCodePoint = 0x10ffff;
128
+ const BACKSPACE = 0x08;
129
+ const CHARACTER_TABULATION = 0x09;
130
+ const LINE_FEED = 0x0a;
131
+ const LINE_TABULATION = 0x0b;
132
+ const FORM_FEED = 0x0c;
133
+ const CARRIAGE_RETURN = 0x0d;
134
+ const EXCLAMATION_MARK = 0x21;
135
+ const DOLLAR_SIGN = 0x24;
136
+ const LEFT_PARENTHESIS = 0x28;
137
+ const RIGHT_PARENTHESIS = 0x29;
138
+ const ASTERISK = 0x2a;
139
+ const PLUS_SIGN = 0x2b;
140
+ const COMMA = 0x2c;
141
+ const HYPHEN_MINUS = 0x2d;
142
+ const FULL_STOP = 0x2e;
143
+ const SOLIDUS = 0x2f;
144
+ const DIGIT_ZERO = 0x30;
145
+ const DIGIT_ONE = 0x31;
146
+ const DIGIT_SEVEN = 0x37;
147
+ const DIGIT_NINE = 0x39;
148
+ const COLON = 0x3a;
149
+ const LESS_THAN_SIGN = 0x3c;
150
+ const EQUALS_SIGN = 0x3d;
151
+ const GREATER_THAN_SIGN = 0x3e;
152
+ const QUESTION_MARK = 0x3f;
153
+ const LATIN_CAPITAL_LETTER_A = 0x41;
154
+ const LATIN_CAPITAL_LETTER_B = 0x42;
155
+ const LATIN_CAPITAL_LETTER_D = 0x44;
156
+ const LATIN_CAPITAL_LETTER_F = 0x46;
157
+ const LATIN_CAPITAL_LETTER_P = 0x50;
158
+ const LATIN_CAPITAL_LETTER_S = 0x53;
159
+ const LATIN_CAPITAL_LETTER_W = 0x57;
160
+ const LATIN_CAPITAL_LETTER_Z = 0x5a;
161
+ const LOW_LINE = 0x5f;
162
+ const LATIN_SMALL_LETTER_A = 0x61;
163
+ const LATIN_SMALL_LETTER_B = 0x62;
164
+ const LATIN_SMALL_LETTER_C = 0x63;
165
+ const LATIN_SMALL_LETTER_D = 0x64;
166
+ const LATIN_SMALL_LETTER_F = 0x66;
167
+ const LATIN_SMALL_LETTER_G = 0x67;
168
+ const LATIN_SMALL_LETTER_I = 0x69;
169
+ const LATIN_SMALL_LETTER_K = 0x6b;
170
+ const LATIN_SMALL_LETTER_M = 0x6d;
171
+ const LATIN_SMALL_LETTER_N = 0x6e;
172
+ const LATIN_SMALL_LETTER_P = 0x70;
173
+ const LATIN_SMALL_LETTER_R = 0x72;
174
+ const LATIN_SMALL_LETTER_S = 0x73;
175
+ const LATIN_SMALL_LETTER_T = 0x74;
176
+ const LATIN_SMALL_LETTER_U = 0x75;
177
+ const LATIN_SMALL_LETTER_V = 0x76;
178
+ const LATIN_SMALL_LETTER_W = 0x77;
179
+ const LATIN_SMALL_LETTER_X = 0x78;
180
+ const LATIN_SMALL_LETTER_Y = 0x79;
181
+ const LATIN_SMALL_LETTER_Z = 0x7a;
182
+ const LEFT_SQUARE_BRACKET = 0x5b;
183
+ const REVERSE_SOLIDUS = 0x5c;
184
+ const RIGHT_SQUARE_BRACKET = 0x5d;
185
+ const CIRCUMFLEX_ACCENT = 0x5e;
186
+ const LEFT_CURLY_BRACKET = 0x7b;
187
+ const VERTICAL_LINE = 0x7c;
188
+ const RIGHT_CURLY_BRACKET = 0x7d;
189
+ const ZERO_WIDTH_NON_JOINER = 0x200c;
190
+ const ZERO_WIDTH_JOINER = 0x200d;
191
+ const LINE_SEPARATOR = 0x2028;
192
+ const PARAGRAPH_SEPARATOR = 0x2029;
193
+ const MIN_CODE_POINT = 0x00;
194
+ const MAX_CODE_POINT = 0x10ffff;
195
195
  function isLatinLetter(code) {
196
- return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) ||
197
- (code >= LatinSmallLetterA && code <= LatinSmallLetterZ));
196
+ return ((code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_Z) ||
197
+ (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_Z));
198
198
  }
199
199
  function isDecimalDigit(code) {
200
- return code >= DigitZero && code <= DigitNine;
200
+ return code >= DIGIT_ZERO && code <= DIGIT_NINE;
201
201
  }
202
202
  function isOctalDigit(code) {
203
- return code >= DigitZero && code <= DigitSeven;
203
+ return code >= DIGIT_ZERO && code <= DIGIT_SEVEN;
204
204
  }
205
205
  function isHexDigit(code) {
206
- return ((code >= DigitZero && code <= DigitNine) ||
207
- (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) ||
208
- (code >= LatinSmallLetterA && code <= LatinSmallLetterF));
206
+ return ((code >= DIGIT_ZERO && code <= DIGIT_NINE) ||
207
+ (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) ||
208
+ (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F));
209
209
  }
210
210
  function isLineTerminator(code) {
211
- return (code === LineFeed ||
212
- code === CarriageReturn ||
213
- code === LineSeparator ||
214
- code === ParagraphSeparator);
211
+ return (code === LINE_FEED ||
212
+ code === CARRIAGE_RETURN ||
213
+ code === LINE_SEPARATOR ||
214
+ code === PARAGRAPH_SEPARATOR);
215
215
  }
216
216
  function isValidUnicode(code) {
217
- return code >= MinCodePoint && code <= MaxCodePoint;
217
+ return code >= MIN_CODE_POINT && code <= MAX_CODE_POINT;
218
218
  }
219
219
  function digitToInt(code) {
220
- if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) {
221
- return code - LatinSmallLetterA + 10;
220
+ if (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F) {
221
+ return code - LATIN_SMALL_LETTER_A + 10;
222
222
  }
223
- if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) {
224
- return code - LatinCapitalLetterA + 10;
223
+ if (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) {
224
+ return code - LATIN_CAPITAL_LETTER_A + 10;
225
225
  }
226
- return code - DigitZero;
226
+ return code - DIGIT_ZERO;
227
227
  }
228
228
  function isLeadSurrogate(code) {
229
229
  return code >= 0xd800 && code <= 0xdbff;
@@ -353,33 +353,33 @@ class RegExpSyntaxError extends SyntaxError {
353
353
  }
354
354
 
355
355
  function isSyntaxCharacter(cp) {
356
- return (cp === CircumflexAccent ||
357
- cp === DollarSign ||
358
- cp === ReverseSolidus ||
359
- cp === FullStop ||
360
- cp === Asterisk ||
361
- cp === PlusSign ||
362
- cp === QuestionMark ||
363
- cp === LeftParenthesis ||
364
- cp === RightParenthesis ||
365
- cp === LeftSquareBracket ||
366
- cp === RightSquareBracket ||
367
- cp === LeftCurlyBracket ||
368
- cp === RightCurlyBracket ||
369
- cp === VerticalLine);
356
+ return (cp === CIRCUMFLEX_ACCENT ||
357
+ cp === DOLLAR_SIGN ||
358
+ cp === REVERSE_SOLIDUS ||
359
+ cp === FULL_STOP ||
360
+ cp === ASTERISK ||
361
+ cp === PLUS_SIGN ||
362
+ cp === QUESTION_MARK ||
363
+ cp === LEFT_PARENTHESIS ||
364
+ cp === RIGHT_PARENTHESIS ||
365
+ cp === LEFT_SQUARE_BRACKET ||
366
+ cp === RIGHT_SQUARE_BRACKET ||
367
+ cp === LEFT_CURLY_BRACKET ||
368
+ cp === RIGHT_CURLY_BRACKET ||
369
+ cp === VERTICAL_LINE);
370
370
  }
371
371
  function isRegExpIdentifierStart(cp) {
372
- return isIdStart(cp) || cp === DollarSign || cp === LowLine;
372
+ return isIdStart(cp) || cp === DOLLAR_SIGN || cp === LOW_LINE;
373
373
  }
374
374
  function isRegExpIdentifierPart(cp) {
375
375
  return (isIdContinue(cp) ||
376
- cp === DollarSign ||
377
- cp === LowLine ||
378
- cp === ZeroWidthNonJoiner ||
379
- cp === ZeroWidthJoiner);
376
+ cp === DOLLAR_SIGN ||
377
+ cp === LOW_LINE ||
378
+ cp === ZERO_WIDTH_NON_JOINER ||
379
+ cp === ZERO_WIDTH_JOINER);
380
380
  }
381
381
  function isUnicodePropertyNameCharacter(cp) {
382
- return isLatinLetter(cp) || cp === LowLine;
382
+ return isLatinLetter(cp) || cp === LOW_LINE;
383
383
  }
384
384
  function isUnicodePropertyValueCharacter(cp) {
385
385
  return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp);
@@ -405,7 +405,7 @@ class RegExpValidator {
405
405
  this._uFlag = this._nFlag = false;
406
406
  this.reset(source, start, end);
407
407
  this.onLiteralEnter(start);
408
- if (this.eat(Solidus) && this.eatRegExpBody() && this.eat(Solidus)) {
408
+ if (this.eat(SOLIDUS) && this.eatRegExpBody() && this.eat(SOLIDUS)) {
409
409
  const flagStart = this.index;
410
410
  const uFlag = source.includes("u", flagStart);
411
411
  this.validateFlags(source, flagStart, end);
@@ -435,32 +435,44 @@ class RegExpValidator {
435
435
  this.raise(`Duplicated flag '${source[i]}'`);
436
436
  }
437
437
  existingFlags.add(flag);
438
- if (flag === LatinSmallLetterG) {
438
+ if (flag === LATIN_SMALL_LETTER_G) {
439
439
  global = true;
440
440
  }
441
- else if (flag === LatinSmallLetterI) {
441
+ else if (flag === LATIN_SMALL_LETTER_I) {
442
442
  ignoreCase = true;
443
443
  }
444
- else if (flag === LatinSmallLetterM) {
444
+ else if (flag === LATIN_SMALL_LETTER_M) {
445
445
  multiline = true;
446
446
  }
447
- else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) {
447
+ else if (flag === LATIN_SMALL_LETTER_U &&
448
+ this.ecmaVersion >= 2015) {
448
449
  unicode = true;
449
450
  }
450
- else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) {
451
+ else if (flag === LATIN_SMALL_LETTER_Y &&
452
+ this.ecmaVersion >= 2015) {
451
453
  sticky = true;
452
454
  }
453
- else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) {
455
+ else if (flag === LATIN_SMALL_LETTER_S &&
456
+ this.ecmaVersion >= 2018) {
454
457
  dotAll = true;
455
458
  }
456
- else if (flag === LatinSmallLetterD && this.ecmaVersion >= 2022) {
459
+ else if (flag === LATIN_SMALL_LETTER_D &&
460
+ this.ecmaVersion >= 2022) {
457
461
  hasIndices = true;
458
462
  }
459
463
  else {
460
464
  this.raise(`Invalid flag '${source[i]}'`);
461
465
  }
462
466
  }
463
- this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices);
467
+ this.onRegExpFlags(start, end, {
468
+ global,
469
+ ignoreCase,
470
+ multiline,
471
+ unicode,
472
+ sticky,
473
+ dotAll,
474
+ hasIndices,
475
+ });
464
476
  }
465
477
  validatePattern(source, start = 0, end = source.length, uFlag = false) {
466
478
  this._uFlag = uFlag && this.ecmaVersion >= 2015;
@@ -492,9 +504,12 @@ class RegExpValidator {
492
504
  this._options.onLiteralLeave(start, end);
493
505
  }
494
506
  }
495
- onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices) {
507
+ onRegExpFlags(start, end, flags) {
508
+ if (this._options.onRegExpFlags) {
509
+ this._options.onRegExpFlags(start, end, flags);
510
+ }
496
511
  if (this._options.onFlags) {
497
- this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices);
512
+ this._options.onFlags(start, end, flags.global, flags.ignoreCase, flags.multiline, flags.unicode, flags.sticky, flags.dotAll, flags.hasIndices);
498
513
  }
499
514
  }
500
515
  onPatternEnter(start) {
@@ -664,17 +679,17 @@ class RegExpValidator {
664
679
  if (escaped) {
665
680
  escaped = false;
666
681
  }
667
- else if (cp === ReverseSolidus) {
682
+ else if (cp === REVERSE_SOLIDUS) {
668
683
  escaped = true;
669
684
  }
670
- else if (cp === LeftSquareBracket) {
685
+ else if (cp === LEFT_SQUARE_BRACKET) {
671
686
  inClass = true;
672
687
  }
673
- else if (cp === RightSquareBracket) {
688
+ else if (cp === RIGHT_SQUARE_BRACKET) {
674
689
  inClass = false;
675
690
  }
676
- else if ((cp === Solidus && !inClass) ||
677
- (cp === Asterisk && this.index === start)) {
691
+ else if ((cp === SOLIDUS && !inClass) ||
692
+ (cp === ASTERISK && this.index === start)) {
678
693
  break;
679
694
  }
680
695
  this.advance();
@@ -690,13 +705,13 @@ class RegExpValidator {
690
705
  this.consumeDisjunction();
691
706
  const cp = this.currentCodePoint;
692
707
  if (this.currentCodePoint !== -1) {
693
- if (cp === RightParenthesis) {
708
+ if (cp === RIGHT_PARENTHESIS) {
694
709
  this.raise("Unmatched ')'");
695
710
  }
696
- if (cp === ReverseSolidus) {
711
+ if (cp === REVERSE_SOLIDUS) {
697
712
  this.raise("\\ at end of pattern");
698
713
  }
699
- if (cp === RightSquareBracket || cp === RightCurlyBracket) {
714
+ if (cp === RIGHT_SQUARE_BRACKET || cp === RIGHT_CURLY_BRACKET) {
700
715
  this.raise("Lone quantifier brackets");
701
716
  }
702
717
  const c = String.fromCodePoint(cp);
@@ -719,21 +734,21 @@ class RegExpValidator {
719
734
  if (escaped) {
720
735
  escaped = false;
721
736
  }
722
- else if (cp === ReverseSolidus) {
737
+ else if (cp === REVERSE_SOLIDUS) {
723
738
  escaped = true;
724
739
  }
725
- else if (cp === LeftSquareBracket) {
740
+ else if (cp === LEFT_SQUARE_BRACKET) {
726
741
  inClass = true;
727
742
  }
728
- else if (cp === RightSquareBracket) {
743
+ else if (cp === RIGHT_SQUARE_BRACKET) {
729
744
  inClass = false;
730
745
  }
731
- else if (cp === LeftParenthesis &&
746
+ else if (cp === LEFT_PARENTHESIS &&
732
747
  !inClass &&
733
- (this.nextCodePoint !== QuestionMark ||
734
- (this.nextCodePoint2 === LessThanSign &&
735
- this.nextCodePoint3 !== EqualsSign &&
736
- this.nextCodePoint3 !== ExclamationMark))) {
748
+ (this.nextCodePoint !== QUESTION_MARK ||
749
+ (this.nextCodePoint2 === LESS_THAN_SIGN &&
750
+ this.nextCodePoint3 !== EQUALS_SIGN &&
751
+ this.nextCodePoint3 !== EXCLAMATION_MARK))) {
737
752
  count += 1;
738
753
  }
739
754
  this.advance();
@@ -747,11 +762,11 @@ class RegExpValidator {
747
762
  this.onDisjunctionEnter(start);
748
763
  do {
749
764
  this.consumeAlternative(i++);
750
- } while (this.eat(VerticalLine));
765
+ } while (this.eat(VERTICAL_LINE));
751
766
  if (this.consumeQuantifier(true)) {
752
767
  this.raise("Nothing to repeat");
753
768
  }
754
- if (this.eat(LeftCurlyBracket)) {
769
+ if (this.eat(LEFT_CURLY_BRACKET)) {
755
770
  this.raise("Lone quantifier brackets");
756
771
  }
757
772
  this.onDisjunctionLeave(start, this.index);
@@ -780,30 +795,31 @@ class RegExpValidator {
780
795
  consumeAssertion() {
781
796
  const start = this.index;
782
797
  this._lastAssertionIsQuantifiable = false;
783
- if (this.eat(CircumflexAccent)) {
798
+ if (this.eat(CIRCUMFLEX_ACCENT)) {
784
799
  this.onEdgeAssertion(start, this.index, "start");
785
800
  return true;
786
801
  }
787
- if (this.eat(DollarSign)) {
802
+ if (this.eat(DOLLAR_SIGN)) {
788
803
  this.onEdgeAssertion(start, this.index, "end");
789
804
  return true;
790
805
  }
791
- if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) {
806
+ if (this.eat2(REVERSE_SOLIDUS, LATIN_CAPITAL_LETTER_B)) {
792
807
  this.onWordBoundaryAssertion(start, this.index, "word", true);
793
808
  return true;
794
809
  }
795
- if (this.eat2(ReverseSolidus, LatinSmallLetterB)) {
810
+ if (this.eat2(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_B)) {
796
811
  this.onWordBoundaryAssertion(start, this.index, "word", false);
797
812
  return true;
798
813
  }
799
- if (this.eat2(LeftParenthesis, QuestionMark)) {
800
- const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign);
814
+ if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) {
815
+ const lookbehind = this.ecmaVersion >= 2018 && this.eat(LESS_THAN_SIGN);
801
816
  let negate = false;
802
- if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) {
817
+ if (this.eat(EQUALS_SIGN) ||
818
+ (negate = this.eat(EXCLAMATION_MARK))) {
803
819
  const kind = lookbehind ? "lookbehind" : "lookahead";
804
820
  this.onLookaroundAssertionEnter(start, kind, negate);
805
821
  this.consumeDisjunction();
806
- if (!this.eat(RightParenthesis)) {
822
+ if (!this.eat(RIGHT_PARENTHESIS)) {
807
823
  this.raise("Unterminated group");
808
824
  }
809
825
  this._lastAssertionIsQuantifiable = !lookbehind && !this.strict;
@@ -819,15 +835,15 @@ class RegExpValidator {
819
835
  let min = 0;
820
836
  let max = 0;
821
837
  let greedy = false;
822
- if (this.eat(Asterisk)) {
838
+ if (this.eat(ASTERISK)) {
823
839
  min = 0;
824
840
  max = Number.POSITIVE_INFINITY;
825
841
  }
826
- else if (this.eat(PlusSign)) {
842
+ else if (this.eat(PLUS_SIGN)) {
827
843
  min = 1;
828
844
  max = Number.POSITIVE_INFINITY;
829
845
  }
830
- else if (this.eat(QuestionMark)) {
846
+ else if (this.eat(QUESTION_MARK)) {
831
847
  min = 0;
832
848
  max = 1;
833
849
  }
@@ -838,7 +854,7 @@ class RegExpValidator {
838
854
  else {
839
855
  return false;
840
856
  }
841
- greedy = !this.eat(QuestionMark);
857
+ greedy = !this.eat(QUESTION_MARK);
842
858
  if (!noConsume) {
843
859
  this.onQuantifier(start, this.index, min, max, greedy);
844
860
  }
@@ -846,17 +862,17 @@ class RegExpValidator {
846
862
  }
847
863
  eatBracedQuantifier(noError) {
848
864
  const start = this.index;
849
- if (this.eat(LeftCurlyBracket)) {
865
+ if (this.eat(LEFT_CURLY_BRACKET)) {
850
866
  this._lastMinValue = 0;
851
867
  this._lastMaxValue = Number.POSITIVE_INFINITY;
852
868
  if (this.eatDecimalDigits()) {
853
869
  this._lastMinValue = this._lastMaxValue = this._lastIntValue;
854
- if (this.eat(Comma)) {
870
+ if (this.eat(COMMA)) {
855
871
  this._lastMaxValue = this.eatDecimalDigits()
856
872
  ? this._lastIntValue
857
873
  : Number.POSITIVE_INFINITY;
858
874
  }
859
- if (this.eat(RightCurlyBracket)) {
875
+ if (this.eat(RIGHT_CURLY_BRACKET)) {
860
876
  if (!noError && this._lastMaxValue < this._lastMinValue) {
861
877
  this.raise("numbers out of order in {} quantifier");
862
878
  }
@@ -879,7 +895,7 @@ class RegExpValidator {
879
895
  this.consumeCapturingGroup());
880
896
  }
881
897
  consumeDot() {
882
- if (this.eat(FullStop)) {
898
+ if (this.eat(FULL_STOP)) {
883
899
  this.onAnyCharacterSet(this.index - 1, this.index, "any");
884
900
  return true;
885
901
  }
@@ -887,7 +903,7 @@ class RegExpValidator {
887
903
  }
888
904
  consumeReverseSolidusAtomEscape() {
889
905
  const start = this.index;
890
- if (this.eat(ReverseSolidus)) {
906
+ if (this.eat(REVERSE_SOLIDUS)) {
891
907
  if (this.consumeAtomEscape()) {
892
908
  return true;
893
909
  }
@@ -897,10 +913,10 @@ class RegExpValidator {
897
913
  }
898
914
  consumeUncapturingGroup() {
899
915
  const start = this.index;
900
- if (this.eat3(LeftParenthesis, QuestionMark, Colon)) {
916
+ if (this.eat3(LEFT_PARENTHESIS, QUESTION_MARK, COLON)) {
901
917
  this.onGroupEnter(start);
902
918
  this.consumeDisjunction();
903
- if (!this.eat(RightParenthesis)) {
919
+ if (!this.eat(RIGHT_PARENTHESIS)) {
904
920
  this.raise("Unterminated group");
905
921
  }
906
922
  this.onGroupLeave(start, this.index);
@@ -910,19 +926,19 @@ class RegExpValidator {
910
926
  }
911
927
  consumeCapturingGroup() {
912
928
  const start = this.index;
913
- if (this.eat(LeftParenthesis)) {
929
+ if (this.eat(LEFT_PARENTHESIS)) {
914
930
  let name = null;
915
931
  if (this.ecmaVersion >= 2018) {
916
932
  if (this.consumeGroupSpecifier()) {
917
933
  name = this._lastStrValue;
918
934
  }
919
935
  }
920
- else if (this.currentCodePoint === QuestionMark) {
936
+ else if (this.currentCodePoint === QUESTION_MARK) {
921
937
  this.raise("Invalid group");
922
938
  }
923
939
  this.onCapturingGroupEnter(start, name);
924
940
  this.consumeDisjunction();
925
- if (!this.eat(RightParenthesis)) {
941
+ if (!this.eat(RIGHT_PARENTHESIS)) {
926
942
  this.raise("Unterminated group");
927
943
  }
928
944
  this.onCapturingGroupLeave(start, this.index, name);
@@ -942,11 +958,11 @@ class RegExpValidator {
942
958
  }
943
959
  consumeReverseSolidusFollowedByC() {
944
960
  const start = this.index;
945
- if (this.currentCodePoint === ReverseSolidus &&
946
- this.nextCodePoint === LatinSmallLetterC) {
961
+ if (this.currentCodePoint === REVERSE_SOLIDUS &&
962
+ this.nextCodePoint === LATIN_SMALL_LETTER_C) {
947
963
  this._lastIntValue = this.currentCodePoint;
948
964
  this.advance();
949
- this.onCharacter(start, this.index, ReverseSolidus);
965
+ this.onCharacter(start, this.index, REVERSE_SOLIDUS);
950
966
  return true;
951
967
  }
952
968
  return false;
@@ -971,17 +987,17 @@ class RegExpValidator {
971
987
  const start = this.index;
972
988
  const cp = this.currentCodePoint;
973
989
  if (cp !== -1 &&
974
- cp !== CircumflexAccent &&
975
- cp !== DollarSign &&
976
- cp !== ReverseSolidus &&
977
- cp !== FullStop &&
978
- cp !== Asterisk &&
979
- cp !== PlusSign &&
980
- cp !== QuestionMark &&
981
- cp !== LeftParenthesis &&
982
- cp !== RightParenthesis &&
983
- cp !== LeftSquareBracket &&
984
- cp !== VerticalLine) {
990
+ cp !== CIRCUMFLEX_ACCENT &&
991
+ cp !== DOLLAR_SIGN &&
992
+ cp !== REVERSE_SOLIDUS &&
993
+ cp !== FULL_STOP &&
994
+ cp !== ASTERISK &&
995
+ cp !== PLUS_SIGN &&
996
+ cp !== QUESTION_MARK &&
997
+ cp !== LEFT_PARENTHESIS &&
998
+ cp !== RIGHT_PARENTHESIS &&
999
+ cp !== LEFT_SQUARE_BRACKET &&
1000
+ cp !== VERTICAL_LINE) {
985
1001
  this.advance();
986
1002
  this.onCharacter(start, this.index, cp);
987
1003
  return true;
@@ -989,7 +1005,7 @@ class RegExpValidator {
989
1005
  return false;
990
1006
  }
991
1007
  consumeGroupSpecifier() {
992
- if (this.eat(QuestionMark)) {
1008
+ if (this.eat(QUESTION_MARK)) {
993
1009
  if (this.eatGroupName()) {
994
1010
  if (!this._groupNames.has(this._lastStrValue)) {
995
1011
  this._groupNames.add(this._lastStrValue);
@@ -1030,32 +1046,32 @@ class RegExpValidator {
1030
1046
  }
1031
1047
  consumeCharacterClassEscape() {
1032
1048
  const start = this.index;
1033
- if (this.eat(LatinSmallLetterD)) {
1049
+ if (this.eat(LATIN_SMALL_LETTER_D)) {
1034
1050
  this._lastIntValue = -1;
1035
1051
  this.onEscapeCharacterSet(start - 1, this.index, "digit", false);
1036
1052
  return true;
1037
1053
  }
1038
- if (this.eat(LatinCapitalLetterD)) {
1054
+ if (this.eat(LATIN_CAPITAL_LETTER_D)) {
1039
1055
  this._lastIntValue = -1;
1040
1056
  this.onEscapeCharacterSet(start - 1, this.index, "digit", true);
1041
1057
  return true;
1042
1058
  }
1043
- if (this.eat(LatinSmallLetterS)) {
1059
+ if (this.eat(LATIN_SMALL_LETTER_S)) {
1044
1060
  this._lastIntValue = -1;
1045
1061
  this.onEscapeCharacterSet(start - 1, this.index, "space", false);
1046
1062
  return true;
1047
1063
  }
1048
- if (this.eat(LatinCapitalLetterS)) {
1064
+ if (this.eat(LATIN_CAPITAL_LETTER_S)) {
1049
1065
  this._lastIntValue = -1;
1050
1066
  this.onEscapeCharacterSet(start - 1, this.index, "space", true);
1051
1067
  return true;
1052
1068
  }
1053
- if (this.eat(LatinSmallLetterW)) {
1069
+ if (this.eat(LATIN_SMALL_LETTER_W)) {
1054
1070
  this._lastIntValue = -1;
1055
1071
  this.onEscapeCharacterSet(start - 1, this.index, "word", false);
1056
1072
  return true;
1057
1073
  }
1058
- if (this.eat(LatinCapitalLetterW)) {
1074
+ if (this.eat(LATIN_CAPITAL_LETTER_W)) {
1059
1075
  this._lastIntValue = -1;
1060
1076
  this.onEscapeCharacterSet(start - 1, this.index, "word", true);
1061
1077
  return true;
@@ -1063,12 +1079,12 @@ class RegExpValidator {
1063
1079
  let negate = false;
1064
1080
  if (this._uFlag &&
1065
1081
  this.ecmaVersion >= 2018 &&
1066
- (this.eat(LatinSmallLetterP) ||
1067
- (negate = this.eat(LatinCapitalLetterP)))) {
1082
+ (this.eat(LATIN_SMALL_LETTER_P) ||
1083
+ (negate = this.eat(LATIN_CAPITAL_LETTER_P)))) {
1068
1084
  this._lastIntValue = -1;
1069
- if (this.eat(LeftCurlyBracket) &&
1085
+ if (this.eat(LEFT_CURLY_BRACKET) &&
1070
1086
  this.eatUnicodePropertyValueExpression() &&
1071
- this.eat(RightCurlyBracket)) {
1087
+ this.eat(RIGHT_CURLY_BRACKET)) {
1072
1088
  this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate);
1073
1089
  return true;
1074
1090
  }
@@ -1094,7 +1110,7 @@ class RegExpValidator {
1094
1110
  }
1095
1111
  consumeKGroupName() {
1096
1112
  const start = this.index;
1097
- if (this.eat(LatinSmallLetterK)) {
1113
+ if (this.eat(LATIN_SMALL_LETTER_K)) {
1098
1114
  if (this.eatGroupName()) {
1099
1115
  const groupName = this._lastStrValue;
1100
1116
  this._backreferenceNames.add(groupName);
@@ -1107,11 +1123,11 @@ class RegExpValidator {
1107
1123
  }
1108
1124
  consumeCharacterClass() {
1109
1125
  const start = this.index;
1110
- if (this.eat(LeftSquareBracket)) {
1111
- const negate = this.eat(CircumflexAccent);
1126
+ if (this.eat(LEFT_SQUARE_BRACKET)) {
1127
+ const negate = this.eat(CIRCUMFLEX_ACCENT);
1112
1128
  this.onCharacterClassEnter(start, negate);
1113
1129
  this.consumeClassRanges();
1114
- if (!this.eat(RightSquareBracket)) {
1130
+ if (!this.eat(RIGHT_SQUARE_BRACKET)) {
1115
1131
  this.raise("Unterminated character class");
1116
1132
  }
1117
1133
  this.onCharacterClassLeave(start, this.index, negate);
@@ -1127,10 +1143,10 @@ class RegExpValidator {
1127
1143
  break;
1128
1144
  }
1129
1145
  const min = this._lastIntValue;
1130
- if (!this.eat(HyphenMinus)) {
1146
+ if (!this.eat(HYPHEN_MINUS)) {
1131
1147
  continue;
1132
1148
  }
1133
- this.onCharacter(this.index - 1, this.index, HyphenMinus);
1149
+ this.onCharacter(this.index - 1, this.index, HYPHEN_MINUS);
1134
1150
  if (!this.consumeClassAtom()) {
1135
1151
  break;
1136
1152
  }
@@ -1150,18 +1166,21 @@ class RegExpValidator {
1150
1166
  consumeClassAtom() {
1151
1167
  const start = this.index;
1152
1168
  const cp = this.currentCodePoint;
1153
- if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) {
1169
+ if (cp !== -1 &&
1170
+ cp !== REVERSE_SOLIDUS &&
1171
+ cp !== RIGHT_SQUARE_BRACKET) {
1154
1172
  this.advance();
1155
1173
  this._lastIntValue = cp;
1156
1174
  this.onCharacter(start, this.index, this._lastIntValue);
1157
1175
  return true;
1158
1176
  }
1159
- if (this.eat(ReverseSolidus)) {
1177
+ if (this.eat(REVERSE_SOLIDUS)) {
1160
1178
  if (this.consumeClassEscape()) {
1161
1179
  return true;
1162
1180
  }
1163
- if (!this.strict && this.currentCodePoint === LatinSmallLetterC) {
1164
- this._lastIntValue = ReverseSolidus;
1181
+ if (!this.strict &&
1182
+ this.currentCodePoint === LATIN_SMALL_LETTER_C) {
1183
+ this._lastIntValue = REVERSE_SOLIDUS;
1165
1184
  this.onCharacter(start, this.index, this._lastIntValue);
1166
1185
  return true;
1167
1186
  }
@@ -1174,21 +1193,21 @@ class RegExpValidator {
1174
1193
  }
1175
1194
  consumeClassEscape() {
1176
1195
  const start = this.index;
1177
- if (this.eat(LatinSmallLetterB)) {
1178
- this._lastIntValue = Backspace;
1196
+ if (this.eat(LATIN_SMALL_LETTER_B)) {
1197
+ this._lastIntValue = BACKSPACE;
1179
1198
  this.onCharacter(start - 1, this.index, this._lastIntValue);
1180
1199
  return true;
1181
1200
  }
1182
- if (this._uFlag && this.eat(HyphenMinus)) {
1183
- this._lastIntValue = HyphenMinus;
1201
+ if (this._uFlag && this.eat(HYPHEN_MINUS)) {
1202
+ this._lastIntValue = HYPHEN_MINUS;
1184
1203
  this.onCharacter(start - 1, this.index, this._lastIntValue);
1185
1204
  return true;
1186
1205
  }
1187
1206
  let cp = 0;
1188
1207
  if (!this.strict &&
1189
1208
  !this._uFlag &&
1190
- this.currentCodePoint === LatinSmallLetterC &&
1191
- (isDecimalDigit((cp = this.nextCodePoint)) || cp === LowLine)) {
1209
+ this.currentCodePoint === LATIN_SMALL_LETTER_C &&
1210
+ (isDecimalDigit((cp = this.nextCodePoint)) || cp === LOW_LINE)) {
1192
1211
  this.advance();
1193
1212
  this.advance();
1194
1213
  this._lastIntValue = cp % 0x20;
@@ -1198,8 +1217,8 @@ class RegExpValidator {
1198
1217
  return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape());
1199
1218
  }
1200
1219
  eatGroupName() {
1201
- if (this.eat(LessThanSign)) {
1202
- if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) {
1220
+ if (this.eat(LESS_THAN_SIGN)) {
1221
+ if (this.eatRegExpIdentifierName() && this.eat(GREATER_THAN_SIGN)) {
1203
1222
  return true;
1204
1223
  }
1205
1224
  this.raise("Invalid capture group name");
@@ -1221,7 +1240,7 @@ class RegExpValidator {
1221
1240
  const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020;
1222
1241
  let cp = this.currentCodePoint;
1223
1242
  this.advance();
1224
- if (cp === ReverseSolidus &&
1243
+ if (cp === REVERSE_SOLIDUS &&
1225
1244
  this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
1226
1245
  cp = this._lastIntValue;
1227
1246
  }
@@ -1245,7 +1264,7 @@ class RegExpValidator {
1245
1264
  const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020;
1246
1265
  let cp = this.currentCodePoint;
1247
1266
  this.advance();
1248
- if (cp === ReverseSolidus &&
1267
+ if (cp === REVERSE_SOLIDUS &&
1249
1268
  this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
1250
1269
  cp = this._lastIntValue;
1251
1270
  }
@@ -1266,7 +1285,7 @@ class RegExpValidator {
1266
1285
  }
1267
1286
  eatCControlLetter() {
1268
1287
  const start = this.index;
1269
- if (this.eat(LatinSmallLetterC)) {
1288
+ if (this.eat(LATIN_SMALL_LETTER_C)) {
1270
1289
  if (this.eatControlLetter()) {
1271
1290
  return true;
1272
1291
  }
@@ -1275,7 +1294,7 @@ class RegExpValidator {
1275
1294
  return false;
1276
1295
  }
1277
1296
  eatZero() {
1278
- if (this.currentCodePoint === DigitZero &&
1297
+ if (this.currentCodePoint === DIGIT_ZERO &&
1279
1298
  !isDecimalDigit(this.nextCodePoint)) {
1280
1299
  this._lastIntValue = 0;
1281
1300
  this.advance();
@@ -1284,24 +1303,24 @@ class RegExpValidator {
1284
1303
  return false;
1285
1304
  }
1286
1305
  eatControlEscape() {
1287
- if (this.eat(LatinSmallLetterF)) {
1288
- this._lastIntValue = FormFeed;
1306
+ if (this.eat(LATIN_SMALL_LETTER_F)) {
1307
+ this._lastIntValue = FORM_FEED;
1289
1308
  return true;
1290
1309
  }
1291
- if (this.eat(LatinSmallLetterN)) {
1292
- this._lastIntValue = LineFeed;
1310
+ if (this.eat(LATIN_SMALL_LETTER_N)) {
1311
+ this._lastIntValue = LINE_FEED;
1293
1312
  return true;
1294
1313
  }
1295
- if (this.eat(LatinSmallLetterR)) {
1296
- this._lastIntValue = CarriageReturn;
1314
+ if (this.eat(LATIN_SMALL_LETTER_R)) {
1315
+ this._lastIntValue = CARRIAGE_RETURN;
1297
1316
  return true;
1298
1317
  }
1299
- if (this.eat(LatinSmallLetterT)) {
1300
- this._lastIntValue = CharacterTabulation;
1318
+ if (this.eat(LATIN_SMALL_LETTER_T)) {
1319
+ this._lastIntValue = CHARACTER_TABULATION;
1301
1320
  return true;
1302
1321
  }
1303
- if (this.eat(LatinSmallLetterV)) {
1304
- this._lastIntValue = LineTabulation;
1322
+ if (this.eat(LATIN_SMALL_LETTER_V)) {
1323
+ this._lastIntValue = LINE_TABULATION;
1305
1324
  return true;
1306
1325
  }
1307
1326
  return false;
@@ -1318,7 +1337,7 @@ class RegExpValidator {
1318
1337
  eatRegExpUnicodeEscapeSequence(forceUFlag = false) {
1319
1338
  const start = this.index;
1320
1339
  const uFlag = forceUFlag || this._uFlag;
1321
- if (this.eat(LatinSmallLetterU)) {
1340
+ if (this.eat(LATIN_SMALL_LETTER_U)) {
1322
1341
  if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) ||
1323
1342
  this.eatFixedHexDigits(4) ||
1324
1343
  (uFlag && this.eatRegExpUnicodeCodePointEscape())) {
@@ -1336,8 +1355,8 @@ class RegExpValidator {
1336
1355
  if (this.eatFixedHexDigits(4)) {
1337
1356
  const lead = this._lastIntValue;
1338
1357
  if (isLeadSurrogate(lead) &&
1339
- this.eat(ReverseSolidus) &&
1340
- this.eat(LatinSmallLetterU) &&
1358
+ this.eat(REVERSE_SOLIDUS) &&
1359
+ this.eat(LATIN_SMALL_LETTER_U) &&
1341
1360
  this.eatFixedHexDigits(4)) {
1342
1361
  const trail = this._lastIntValue;
1343
1362
  if (isTrailSurrogate(trail)) {
@@ -1351,9 +1370,9 @@ class RegExpValidator {
1351
1370
  }
1352
1371
  eatRegExpUnicodeCodePointEscape() {
1353
1372
  const start = this.index;
1354
- if (this.eat(LeftCurlyBracket) &&
1373
+ if (this.eat(LEFT_CURLY_BRACKET) &&
1355
1374
  this.eatHexDigits() &&
1356
- this.eat(RightCurlyBracket) &&
1375
+ this.eat(RIGHT_CURLY_BRACKET) &&
1357
1376
  isValidUnicode(this._lastIntValue)) {
1358
1377
  return true;
1359
1378
  }
@@ -1374,32 +1393,32 @@ class RegExpValidator {
1374
1393
  return false;
1375
1394
  }
1376
1395
  if (this._uFlag) {
1377
- return isSyntaxCharacter(cp) || cp === Solidus;
1396
+ return isSyntaxCharacter(cp) || cp === SOLIDUS;
1378
1397
  }
1379
1398
  if (this.strict) {
1380
1399
  return !isIdContinue(cp);
1381
1400
  }
1382
1401
  if (this._nFlag) {
1383
- return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK);
1402
+ return !(cp === LATIN_SMALL_LETTER_C || cp === LATIN_SMALL_LETTER_K);
1384
1403
  }
1385
- return cp !== LatinSmallLetterC;
1404
+ return cp !== LATIN_SMALL_LETTER_C;
1386
1405
  }
1387
1406
  eatDecimalEscape() {
1388
1407
  this._lastIntValue = 0;
1389
1408
  let cp = this.currentCodePoint;
1390
- if (cp >= DigitOne && cp <= DigitNine) {
1409
+ if (cp >= DIGIT_ONE && cp <= DIGIT_NINE) {
1391
1410
  do {
1392
- this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero);
1411
+ this._lastIntValue = 10 * this._lastIntValue + (cp - DIGIT_ZERO);
1393
1412
  this.advance();
1394
- } while ((cp = this.currentCodePoint) >= DigitZero &&
1395
- cp <= DigitNine);
1413
+ } while ((cp = this.currentCodePoint) >= DIGIT_ZERO &&
1414
+ cp <= DIGIT_NINE);
1396
1415
  return true;
1397
1416
  }
1398
1417
  return false;
1399
1418
  }
1400
1419
  eatUnicodePropertyValueExpression() {
1401
1420
  const start = this.index;
1402
- if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) {
1421
+ if (this.eatUnicodePropertyName() && this.eat(EQUALS_SIGN)) {
1403
1422
  this._lastKeyValue = this._lastStrValue;
1404
1423
  if (this.eatUnicodePropertyValue()) {
1405
1424
  this._lastValValue = this._lastStrValue;
@@ -1447,7 +1466,7 @@ class RegExpValidator {
1447
1466
  }
1448
1467
  eatHexEscapeSequence() {
1449
1468
  const start = this.index;
1450
- if (this.eat(LatinSmallLetterX)) {
1469
+ if (this.eat(LATIN_SMALL_LETTER_X)) {
1451
1470
  if (this.eatFixedHexDigits(2)) {
1452
1471
  return true;
1453
1472
  }
@@ -1501,7 +1520,7 @@ class RegExpValidator {
1501
1520
  const cp = this.currentCodePoint;
1502
1521
  if (isOctalDigit(cp)) {
1503
1522
  this.advance();
1504
- this._lastIntValue = cp - DigitZero;
1523
+ this._lastIntValue = cp - DIGIT_ZERO;
1505
1524
  return true;
1506
1525
  }
1507
1526
  this._lastIntValue = 0;
@@ -1523,14 +1542,14 @@ class RegExpValidator {
1523
1542
  }
1524
1543
  }
1525
1544
 
1526
- const DummyPattern = {};
1527
- const DummyFlags = {};
1528
- const DummyCapturingGroup = {};
1545
+ const DUMMY_PATTERN = {};
1546
+ const DUMMY_FLAGS = {};
1547
+ const DUMMY_CAPTURING_GROUP = {};
1529
1548
  class RegExpParserState {
1530
1549
  constructor(options) {
1531
1550
  var _a;
1532
- this._node = DummyPattern;
1533
- this._flags = DummyFlags;
1551
+ this._node = DUMMY_PATTERN;
1552
+ this._flags = DUMMY_FLAGS;
1534
1553
  this._backreferences = [];
1535
1554
  this._capturingGroups = [];
1536
1555
  this.source = "";
@@ -1549,7 +1568,7 @@ class RegExpParserState {
1549
1568
  }
1550
1569
  return this._flags;
1551
1570
  }
1552
- onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices) {
1571
+ onRegExpFlags(start, end, { global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices, }) {
1553
1572
  this._flags = {
1554
1573
  type: "Flags",
1555
1574
  parent: null,
@@ -1820,7 +1839,7 @@ class RegExpParserState {
1820
1839
  end,
1821
1840
  raw: this.source.slice(start, end),
1822
1841
  ref,
1823
- resolved: DummyCapturingGroup,
1842
+ resolved: DUMMY_CAPTURING_GROUP,
1824
1843
  };
1825
1844
  parent.elements.push(node);
1826
1845
  this._backreferences.push(node);
@@ -1866,7 +1885,7 @@ class RegExpParserState {
1866
1885
  min.type !== "Character" ||
1867
1886
  max.type !== "Character" ||
1868
1887
  hyphen.type !== "Character" ||
1869
- hyphen.value !== HyphenMinus) {
1888
+ hyphen.value !== HYPHEN_MINUS) {
1870
1889
  throw new Error("UnknownError");
1871
1890
  }
1872
1891
  const node = {