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

Unified Diff: src/parser.h

Issue 1451373003: Revert of Experimental support for RegExp lookbehind. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/flag-definitions.h ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index a73fb6b87a5f9a0bf40089a9d24017a39a9ced5e..8ff7b176f47f34dd7f7e8eb822d9dcd817388884 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -450,7 +450,7 @@
bool simple();
bool contains_anchor() { return contains_anchor_; }
void set_contains_anchor() { contains_anchor_ = true; }
- int captures_started() { return captures_started_; }
+ int captures_started() { return captures_ == NULL ? 0 : captures_->length(); }
int position() { return next_pos_ - 1; }
bool failed() { return failed_; }
@@ -463,8 +463,8 @@
enum SubexpressionType {
INITIAL,
CAPTURE, // All positive values represent captures.
- POSITIVE_LOOKAROUND,
- NEGATIVE_LOOKAROUND,
+ POSITIVE_LOOKAHEAD,
+ NEGATIVE_LOOKAHEAD,
GROUPING
};
@@ -472,12 +472,11 @@
public:
RegExpParserState(RegExpParserState* previous_state,
SubexpressionType group_type,
- RegExpLookaround::Type lookaround_type,
- int disjunction_capture_index, Zone* zone)
+ int disjunction_capture_index,
+ Zone* zone)
: previous_state_(previous_state),
- builder_(new (zone) RegExpBuilder(zone)),
+ builder_(new(zone) RegExpBuilder(zone)),
group_type_(group_type),
- lookaround_type_(lookaround_type),
disjunction_capture_index_(disjunction_capture_index) {}
// Parser state of containing expression, if any.
RegExpParserState* previous_state() { return previous_state_; }
@@ -486,15 +485,10 @@
RegExpBuilder* builder() { return builder_; }
// Type of regexp being parsed (parenthesized group or entire regexp).
SubexpressionType group_type() { return group_type_; }
- // Lookahead or Lookbehind.
- RegExpLookaround::Type lookaround_type() { return lookaround_type_; }
// Index in captures array of first capture in this sub-expression, if any.
// Also the capture index of this sub-expression itself, if group_type
// is CAPTURE.
int capture_index() { return disjunction_capture_index_; }
-
- // Check whether the parser is inside a capture group with the given index.
- bool IsInsideCaptureGroup(int index);
private:
// Linked list implementation of stack of states.
@@ -503,14 +497,9 @@
RegExpBuilder* builder_;
// Stored disjunction type (capture, look-ahead or grouping), if any.
SubexpressionType group_type_;
- // Stored read direction.
- RegExpLookaround::Type lookaround_type_;
// Stored disjunction's capture index (if any).
int disjunction_capture_index_;
};
-
- // Return the 1-indexed RegExpCapture object, allocate if necessary.
- RegExpCapture* GetCapture(int index);
Isolate* isolate() { return isolate_; }
Zone* zone() const { return zone_; }
@@ -529,7 +518,6 @@
FlatStringReader* in_;
uc32 current_;
int next_pos_;
- int captures_started_;
// The capture count is only valid after we have scanned for captures.
int capture_count_;
bool has_more_;
« no previous file with comments | « src/flag-definitions.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698