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

Unified Diff: src/ast.h

Issue 10890: Add .*?(...) to regexps (Closed)
Patch Set: Created 12 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 | « no previous file | src/jsregexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 89b68c20042dc30ea241009468f8b86d5f2d1b4e..f28299698a9d6000b42804001f57f5e9dd069967 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -1274,6 +1274,11 @@ class RegExpCharacterClass: public RegExpTree {
RegExpCharacterClass(ZoneList<CharacterRange>* ranges, bool is_negated)
: ranges_(ranges),
is_negated_(is_negated) { }
+ RegExpCharacterClass(uc16 type)
+ : ranges_(new ZoneList<CharacterRange>(2)),
+ is_negated_(false) {
+ CharacterRange::AddClassEscape(type, ranges_);
+ }
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success,
@@ -1312,6 +1317,13 @@ class RegExpQuantifier: public RegExpTree {
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success,
RegExpNode* on_failure);
+ static RegExpNode* ToNode(int min,
+ int max,
+ bool is_greedy,
+ RegExpTree* body,
+ RegExpCompiler* compiler,
+ RegExpNode* on_success,
+ RegExpNode* on_failure);
virtual RegExpQuantifier* AsQuantifier();
int min() { return min_; }
int max() { return max_; }
@@ -1336,11 +1348,16 @@ class RegExpCapture: public RegExpTree {
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success,
RegExpNode* on_failure);
+ static RegExpNode* ToNode(RegExpTree* body,
+ int index,
+ RegExpCompiler* compiler,
+ RegExpNode* on_success,
+ RegExpNode* on_failure);
virtual RegExpCapture* AsCapture();
RegExpTree* body() { return body_; }
int index() { return index_; }
- static int StartRegister(int index) { return (index - 1) * 2; }
- static int EndRegister(int index) { return (index - 1) * 2 + 1; }
+ static int StartRegister(int index) { return index * 2; }
+ static int EndRegister(int index) { return index * 2 + 1; }
private:
RegExpTree* body_;
int index_;
« no previous file with comments | « no previous file | src/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698