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

Unified Diff: src/jsregexp.cc

Issue 11473: Bugfixes (Closed)
Patch Set: Created 12 years, 1 month 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 | « no previous file | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.cc
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index 6a065d4b3c0b314eb995e962612bff8c84bb9fec..3c9ef6a5c49353f732bd70ddd0d533599ba38eb5 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -1746,6 +1746,12 @@ static const uc16 kDigitRanges[kDigitRangeCount] = {
};
+static const int kLineTerminatorRangeCount = 6;
+static const uc16 kLineTerminatorRanges[kLineTerminatorRangeCount] = {
+ 0x000A, 0x000A, 0x000D, 0x000D, 0x2028, 0x2029
+};
+
+
static void AddClass(const uc16* elmv,
int elmc,
ZoneList<CharacterRange>* ranges) {
@@ -1794,6 +1800,14 @@ void CharacterRange::AddClassEscape(uc16 type,
AddClassNegated(kDigitRanges, kDigitRangeCount, ranges);
break;
case '.':
+ AddClassNegated(kLineTerminatorRanges,
+ kLineTerminatorRangeCount,
+ ranges);
+ break;
+ // This is not a character range as defined by the spec but a
+ // convenient shorthand for a character class that matches any
+ // character.
+ case '*':
ranges->Add(CharacterRange::Everything());
break;
default:
@@ -2211,7 +2225,7 @@ Handle<FixedArray> RegExpEngine::Compile(RegExpParseResult* input,
RegExpNode* node = RegExpQuantifier::ToNode(0,
RegExpQuantifier::kInfinity,
false,
- new RegExpCharacterClass('.'),
+ new RegExpCharacterClass('*'),
&compiler,
captured_body,
compiler.backtrack());
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698