OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |