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

Unified Diff: src/ast.cc

Issue 3812012: Revert revision 5657. (Closed)
Patch Set: Created 10 years, 2 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/ast.h ('k') | src/bytecodes-irregexp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 92f14961b804d50b28520da8dc11977a3ae21bfe..f47dffd8d734f7cf25622c5ada623efc0e12965d 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -398,70 +398,39 @@ Interval RegExpQuantifier::CaptureRegisters() {
}
-bool RegExpAssertion::IsAnchoredAtStart() {
+bool RegExpAssertion::IsAnchored() {
return type() == RegExpAssertion::START_OF_INPUT;
}
-bool RegExpAssertion::IsAnchoredAtEnd() {
- return type() == RegExpAssertion::END_OF_INPUT;
-}
-
-
-bool RegExpAlternative::IsAnchoredAtStart() {
+bool RegExpAlternative::IsAnchored() {
ZoneList<RegExpTree*>* nodes = this->nodes();
for (int i = 0; i < nodes->length(); i++) {
RegExpTree* node = nodes->at(i);
- if (node->IsAnchoredAtStart()) { return true; }
- if (node->max_match() > 0) { return false; }
- }
- return false;
-}
-
-
-bool RegExpAlternative::IsAnchoredAtEnd() {
- ZoneList<RegExpTree*>* nodes = this->nodes();
- for (int i = nodes->length() - 1; i >= 0; i--) {
- RegExpTree* node = nodes->at(i);
- if (node->IsAnchoredAtEnd()) { return true; }
+ if (node->IsAnchored()) { return true; }
if (node->max_match() > 0) { return false; }
}
return false;
}
-bool RegExpDisjunction::IsAnchoredAtStart() {
+bool RegExpDisjunction::IsAnchored() {
ZoneList<RegExpTree*>* alternatives = this->alternatives();
for (int i = 0; i < alternatives->length(); i++) {
- if (!alternatives->at(i)->IsAnchoredAtStart())
+ if (!alternatives->at(i)->IsAnchored())
return false;
}
return true;
}
-bool RegExpDisjunction::IsAnchoredAtEnd() {
- ZoneList<RegExpTree*>* alternatives = this->alternatives();
- for (int i = 0; i < alternatives->length(); i++) {
- if (!alternatives->at(i)->IsAnchoredAtEnd())
- return false;
- }
- return true;
-}
-
-
-bool RegExpLookahead::IsAnchoredAtStart() {
- return is_positive() && body()->IsAnchoredAtStart();
-}
-
-
-bool RegExpCapture::IsAnchoredAtStart() {
- return body()->IsAnchoredAtStart();
+bool RegExpLookahead::IsAnchored() {
+ return is_positive() && body()->IsAnchored();
}
-bool RegExpCapture::IsAnchoredAtEnd() {
- return body()->IsAnchoredAtEnd();
+bool RegExpCapture::IsAnchored() {
+ return body()->IsAnchored();
}
« no previous file with comments | « src/ast.h ('k') | src/bytecodes-irregexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698