Index: src/ast.cc |
diff --git a/src/ast.cc b/src/ast.cc |
index b5c6cf57ea417cf8a70e266ac83bf82e72d31734..1b0c3f98255ccf09e3729a672d1e16494f514769 100644 |
--- a/src/ast.cc |
+++ b/src/ast.cc |
@@ -850,7 +850,7 @@ Interval RegExpDisjunction::CaptureRegisters() { |
} |
-Interval RegExpLookahead::CaptureRegisters() { |
+Interval RegExpLookaround::CaptureRegisters() { |
return body()->CaptureRegisters(); |
} |
@@ -918,8 +918,8 @@ bool RegExpDisjunction::IsAnchoredAtEnd() { |
} |
-bool RegExpLookahead::IsAnchoredAtStart() { |
- return is_positive() && body()->IsAnchoredAtStart(); |
+bool RegExpLookaround::IsAnchoredAtStart() { |
+ return is_positive() && type() == LOOKAHEAD && body()->IsAnchoredAtStart(); |
} |
@@ -1068,8 +1068,10 @@ void* RegExpUnparser::VisitCapture(RegExpCapture* that, void* data) { |
} |
-void* RegExpUnparser::VisitLookahead(RegExpLookahead* that, void* data) { |
- os_ << "(-> " << (that->is_positive() ? "+ " : "- "); |
+void* RegExpUnparser::VisitLookaround(RegExpLookaround* that, void* data) { |
+ os_ << "("; |
+ os_ << (that->type() == RegExpLookaround::LOOKAHEAD ? "->" : "<-"); |
+ os_ << (that->is_positive() ? " + " : " - "); |
that->body()->Accept(this, data); |
os_ << ")"; |
return NULL; |