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

Side by Side Diff: src/regexp/regexp-ast.cc

Issue 2636883002: [regexp] Implement regexp groups as wrapper. (Closed)
Patch Set: fix Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/regexp/regexp-ast.h ('k') | src/regexp/regexp-parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/ostreams.h" 5 #include "src/ostreams.h"
6 #include "src/regexp/regexp-ast.h" 6 #include "src/regexp/regexp-ast.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 } 257 }
258 258
259 259
260 void* RegExpUnparser::VisitCapture(RegExpCapture* that, void* data) { 260 void* RegExpUnparser::VisitCapture(RegExpCapture* that, void* data) {
261 os_ << "(^ "; 261 os_ << "(^ ";
262 that->body()->Accept(this, data); 262 that->body()->Accept(this, data);
263 os_ << ")"; 263 os_ << ")";
264 return NULL; 264 return NULL;
265 } 265 }
266 266
267 void* RegExpUnparser::VisitGroup(RegExpGroup* that, void* data) {
268 os_ << "(?: ";
269 that->body()->Accept(this, data);
270 os_ << ")";
271 return NULL;
272 }
267 273
268 void* RegExpUnparser::VisitLookaround(RegExpLookaround* that, void* data) { 274 void* RegExpUnparser::VisitLookaround(RegExpLookaround* that, void* data) {
269 os_ << "("; 275 os_ << "(";
270 os_ << (that->type() == RegExpLookaround::LOOKAHEAD ? "->" : "<-"); 276 os_ << (that->type() == RegExpLookaround::LOOKAHEAD ? "->" : "<-");
271 os_ << (that->is_positive() ? " + " : " - "); 277 os_ << (that->is_positive() ? " + " : " - ");
272 that->body()->Accept(this, data); 278 that->body()->Accept(this, data);
273 os_ << ")"; 279 os_ << ")";
274 return NULL; 280 return NULL;
275 } 281 }
276 282
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 int node_min_match = node->min_match(); 334 int node_min_match = node->min_match();
329 min_match_ = IncreaseBy(min_match_, node_min_match); 335 min_match_ = IncreaseBy(min_match_, node_min_match);
330 int node_max_match = node->max_match(); 336 int node_max_match = node->max_match();
331 max_match_ = IncreaseBy(max_match_, node_max_match); 337 max_match_ = IncreaseBy(max_match_, node_max_match);
332 } 338 }
333 } 339 }
334 340
335 341
336 } // namespace internal 342 } // namespace internal
337 } // namespace v8 343 } // namespace v8
OLDNEW
« no previous file with comments | « src/regexp/regexp-ast.h ('k') | src/regexp/regexp-parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698