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

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

Issue 2050343002: [regexp] Experimental support for regexp named captures (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Proper fixed array cast Created 4 years, 6 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
Index: src/regexp/regexp-ast.h
diff --git a/src/regexp/regexp-ast.h b/src/regexp/regexp-ast.h
index 39c9ceea4ea275c879205b1b24884a2f1fccd43c..97d6870e211b6c359c39a0614c25c17729c8178d 100644
--- a/src/regexp/regexp-ast.h
+++ b/src/regexp/regexp-ast.h
@@ -427,12 +427,15 @@ class RegExpCapture final : public RegExpTree {
RegExpTree* body() { return body_; }
void set_body(RegExpTree* body) { body_ = body; }
int index() { return index_; }
+ Vector<const uc16> name() const { return name_; }
+ void set_name(Vector<const uc16> name) { name_ = name; }
static int StartRegister(int index) { return index * 2; }
static int EndRegister(int index) { return index * 2 + 1; }
private:
RegExpTree* body_;
int index_;
+ Vector<const uc16> name_;
};
@@ -489,6 +492,7 @@ class RegExpLookaround final : public RegExpTree {
class RegExpBackReference final : public RegExpTree {
public:
+ RegExpBackReference() : capture_(nullptr) {}
explicit RegExpBackReference(RegExpCapture* capture) : capture_(capture) {}
void* Accept(RegExpVisitor* visitor, void* data) override;
RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success) override;
@@ -500,9 +504,13 @@ class RegExpBackReference final : public RegExpTree {
int max_match() override { return kInfinity; }
int index() { return capture_->index(); }
RegExpCapture* capture() { return capture_; }
+ void set_capture(RegExpCapture* capture) { capture_ = capture; }
+ Vector<const uc16> name() const { return name_; }
+ void set_name(Vector<const uc16> name) { name_ = name; }
private:
RegExpCapture* capture_;
+ Vector<const uc16> name_;
};
« no previous file with comments | « src/regexp/jsregexp.cc ('k') | src/regexp/regexp-parser.h » ('j') | src/regexp/regexp-parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698