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

Unified Diff: src/parser.cc

Issue 39128: Merge revisions 1412 and 1416 from bleeding_edge to trunk... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 11 years, 10 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/api.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
===================================================================
--- src/parser.cc (revision 1415)
+++ src/parser.cc (working copy)
@@ -3607,7 +3607,7 @@
next_pos_(0),
in_(in),
error_(error),
- simple_(true),
+ simple_(false),
contains_anchor_(false),
captures_(NULL),
is_scanned_for_captures_(false),
@@ -3677,6 +3677,11 @@
if (has_more()) {
ReportError(CStrVector("Unmatched ')'") CHECK_FAILED);
}
+ // If the result of parsing is a literal string atom, and it has the
+ // same length as the input, then the atom is identical to the input.
+ if (result->IsAtom() && result->AsAtom()->length() == in()->length()) {
+ simple_ = true;
+ }
return result;
}
@@ -3876,7 +3881,6 @@
Advance(2);
break;
}
- simple_ = false;
break;
case '{': {
int dummy;
@@ -3933,7 +3937,6 @@
is_greedy = false;
Advance();
}
- simple_ = false; // Adding quantifier might *remove* look-ahead.
builder.AddQuantifierToAtom(min, max, is_greedy);
}
}
« no previous file with comments | « src/api.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698