| 531 | }; |
| 532 | |
| 533 | int RepetitionWalker::PreVisit(Regexp* re, int parent_arg, bool* stop) { |
| 534 | int arg = parent_arg; |
| 535 | if (re->op() == kRegexpRepeat) { |
| 536 | int m = re->max(); |
| 537 | if (m < 0) { |
| 538 | m = re->min(); |
| 539 | } |
| 540 | if (m > 0) { |
| 541 | arg /= m; |
| 542 | } |
| 543 | } |
| 544 | return arg; |
| 545 | } |
| 546 | |
| 547 | int RepetitionWalker::PostVisit(Regexp* re, int parent_arg, int pre_arg, |
| 548 | int* child_args, int nchild_args) { |