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

Unified Diff: src/regexp/regexp-parser.h

Issue 2788873002: [regexp] Allow named captures and back-references in non-unicode patterns (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | src/regexp/regexp-parser.cc » ('j') | test/mjsunit/harmony/regexp-named-captures.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-parser.h
diff --git a/src/regexp/regexp-parser.h b/src/regexp/regexp-parser.h
index 62f740d56fa173f6a130318185cb4b7a8dc89b1e..a3ef22d8b7ac8f83fe0dc777bfeb49010d780574 100644
--- a/src/regexp/regexp-parser.h
+++ b/src/regexp/regexp-parser.h
@@ -293,6 +293,10 @@ class RegExpParser BASE_EMBEDDED {
Handle<FixedArray> CreateCaptureNameMap();
+ // Returns true iff the pattern contains named captures. May call
+ // ScanForCaptures to look ahead at the remaining pattern.
+ bool HasNamedCaptures();
+
Isolate* isolate() { return isolate_; }
Zone* zone() const { return zone_; }
@@ -319,12 +323,12 @@ class RegExpParser BASE_EMBEDDED {
bool unicode_;
int next_pos_;
int captures_started_;
- // The capture count is only valid after we have scanned for captures.
- int capture_count_;
+ int capture_count_; // Only valid after we have scanned for captures.
bool has_more_;
bool simple_;
bool contains_anchor_;
bool is_scanned_for_captures_;
+ bool has_named_captures_; // Only valid after we have scanned for captures.
bool failed_;
};
« no previous file with comments | « no previous file | src/regexp/regexp-parser.cc » ('j') | test/mjsunit/harmony/regexp-named-captures.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698