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(); |
} |