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

Unified Diff: src/parser.cc

Issue 10793: More assertion propagation. (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 | « src/parser.h ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index a1a4a6b10f50809985f04f6a5cc4a303d34b586d..3a670f2bcea76c7947b8730758afa4606af50cb8 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -545,7 +545,7 @@ class RegExpParser {
bool CaptureAvailable(int index);
uc32 current_;
bool has_more_;
- bool multiline_mode_;
+ bool multiline_;
int next_pos_;
FlatStringReader* in_;
Handle<String>* error_;
@@ -3499,10 +3499,10 @@ Expression* Parser::NewThrowError(Handle<String> constructor,
RegExpParser::RegExpParser(FlatStringReader* in,
Handle<String>* error,
- bool multiline_mode)
+ bool multiline)
: current_(kEndMarker),
has_more_(true),
- multiline_mode_(multiline_mode),
+ multiline_(multiline),
next_pos_(0),
in_(in),
error_(error),
@@ -3617,16 +3617,16 @@ RegExpTree* RegExpParser::ParseDisjunction(bool* ok) {
case '^': {
Advance();
RegExpAssertion::Type type =
- multiline_mode_ ? RegExpAssertion::START_OF_LINE :
- RegExpAssertion::START_OF_INPUT;
+ multiline_ ? RegExpAssertion::START_OF_LINE :
+ RegExpAssertion::START_OF_INPUT;
builder.AddAssertion(new RegExpAssertion(type));
continue;
}
case '$': {
Advance();
RegExpAssertion::Type type =
- multiline_mode_ ? RegExpAssertion::END_OF_LINE :
- RegExpAssertion::END_OF_INPUT;
+ multiline_ ? RegExpAssertion::END_OF_LINE :
+ RegExpAssertion::END_OF_INPUT;
builder.AddAssertion(new RegExpAssertion(type));
continue;
}
@@ -4294,10 +4294,12 @@ ScriptDataImpl* PreParse(unibrow::CharacterStream* stream,
}
-bool ParseRegExp(FlatStringReader* input, RegExpParseResult* result) {
+bool ParseRegExp(FlatStringReader* input,
+ bool multiline,
+ RegExpParseResult* result) {
ASSERT(result != NULL);
// TODO(plesner): Get multiline flag somehow
Erik Corry 2008/11/27 10:30:05 out of date comment
- RegExpParser parser(input, &result->error, false);
+ RegExpParser parser(input, &result->error, multiline);
bool ok = true;
result->tree = parser.ParsePattern(&ok);
if (!ok) {
« no previous file with comments | « src/parser.h ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698