Creates a concatenation of two Regexp, consuming refs to re1 and re2. Returns a new Regexp, handing the ref to the caller.
| 571 | // Creates a concatenation of two Regexp, consuming refs to re1 and re2. |
| 572 | // Returns a new Regexp, handing the ref to the caller. |
| 573 | Regexp* SimplifyWalker::Concat2(Regexp* re1, Regexp* re2, |
| 574 | Regexp::ParseFlags parse_flags) { |
| 575 | Regexp* re = new Regexp(kRegexpConcat, parse_flags); |
| 576 | re->AllocSub(2); |
| 577 | Regexp** subs = re->sub(); |
| 578 | subs[0] = re1; |
| 579 | subs[1] = re2; |
| 580 | return re; |
| 581 | } |
| 582 | |
| 583 | // Simplifies the expression re{min,max} in terms of *, +, and ?. |
| 584 | // Returns a new regexp. Does not edit re. Does not consume reference to re. |