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

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: Rebase 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
« no previous file with comments | « src/regexp/jsregexp.cc ('k') | src/regexp/regexp-parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-ast.h
diff --git a/src/regexp/regexp-ast.h b/src/regexp/regexp-ast.h
index 39c9ceea4ea275c879205b1b24884a2f1fccd43c..406bf84233b3c5e155ec85cf9f67b64260084422 100644
--- a/src/regexp/regexp-ast.h
+++ b/src/regexp/regexp-ast.h
@@ -7,6 +7,7 @@
#include "src/objects.h"
#include "src/utils.h"
+#include "src/zone-containers.h"
#include "src/zone.h"
namespace v8 {
@@ -412,7 +413,8 @@ class RegExpQuantifier final : public RegExpTree {
class RegExpCapture final : public RegExpTree {
public:
- explicit RegExpCapture(int index) : body_(NULL), index_(index) {}
+ explicit RegExpCapture(int index)
+ : body_(NULL), index_(index), name_(nullptr) {}
void* Accept(RegExpVisitor* visitor, void* data) override;
RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success) override;
static RegExpNode* ToNode(RegExpTree* body, int index,
@@ -427,12 +429,15 @@ class RegExpCapture final : public RegExpTree {
RegExpTree* body() { return body_; }
void set_body(RegExpTree* body) { body_ = body; }
int index() { return index_; }
+ const ZoneVector<uc16>* name() const { return name_; }
+ void set_name(const ZoneVector<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_;
+ const ZoneVector<uc16>* name_;
};
@@ -489,7 +494,9 @@ class RegExpLookaround final : public RegExpTree {
class RegExpBackReference final : public RegExpTree {
public:
- explicit RegExpBackReference(RegExpCapture* capture) : capture_(capture) {}
+ RegExpBackReference() : capture_(nullptr), name_(nullptr) {}
+ explicit RegExpBackReference(RegExpCapture* capture)
+ : capture_(capture), name_(nullptr) {}
void* Accept(RegExpVisitor* visitor, void* data) override;
RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success) override;
RegExpBackReference* AsBackReference() override;
@@ -500,9 +507,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; }
+ const ZoneVector<uc16>* name() const { return name_; }
+ void set_name(const ZoneVector<uc16>* name) { name_ = name; }
private:
RegExpCapture* capture_;
+ const ZoneVector<uc16>* name_;
};
« no previous file with comments | « src/regexp/jsregexp.cc ('k') | src/regexp/regexp-parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698