Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: src/regexp/regexp-parser.cc

Issue 1641593002: [regexp] character class for desugaring cannot be part of RegExpText. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/regexp/regexp-parser.h ('k') | test/mjsunit/harmony/unicode-regexp-ignore-case.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-parser.cc
diff --git a/src/regexp/regexp-parser.cc b/src/regexp/regexp-parser.cc
index be2cf7c42a880671c3f288d2186d4972a52ac9ff..77a741f1e8544a43abc48204bf058d66ba4fcc11 100644
--- a/src/regexp/regexp-parser.cc
+++ b/src/regexp/regexp-parser.cc
@@ -1073,7 +1073,7 @@ void RegExpBuilder::AddTrailSurrogate(uc16 trail_surrogate) {
uc32 combined =
unibrow::Utf16::CombineSurrogatePair(lead_surrogate, trail_surrogate);
if (NeedsDesugaringForIgnoreCase(combined)) {
- AddCharacterClass(combined);
+ AddCharacterClassForDesugaring(combined);
} else {
ZoneList<uc16> surrogate_pair(2, zone());
surrogate_pair.Add(lead_surrogate, zone());
@@ -1094,7 +1094,7 @@ void RegExpBuilder::FlushPendingSurrogate() {
DCHECK(unicode());
uc32 c = pending_surrogate_;
pending_surrogate_ = kNoPendingSurrogate;
- AddCharacterClass(c);
+ AddCharacterClassForDesugaring(c);
}
}
@@ -1131,7 +1131,7 @@ void RegExpBuilder::AddCharacter(uc16 c) {
FlushPendingSurrogate();
pending_empty_ = false;
if (NeedsDesugaringForIgnoreCase(c)) {
- AddCharacterClass(c);
+ AddCharacterClassForDesugaring(c);
} else {
if (characters_ == NULL) {
characters_ = new (zone()) ZoneList<uc16>(4, zone());
@@ -1170,9 +1170,8 @@ void RegExpBuilder::AddCharacterClass(RegExpCharacterClass* cc) {
}
}
-
-void RegExpBuilder::AddCharacterClass(uc32 c) {
- AddCharacterClass(new (zone()) RegExpCharacterClass(
+void RegExpBuilder::AddCharacterClassForDesugaring(uc32 c) {
+ AddTerm(new (zone()) RegExpCharacterClass(
CharacterRange::List(zone(), CharacterRange::Singleton(c)), false));
}
« no previous file with comments | « src/regexp/regexp-parser.h ('k') | test/mjsunit/harmony/unicode-regexp-ignore-case.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698