| 625 | } |
| 626 | |
| 627 | virtual Ignored PreVisit(Regexp* re, Ignored ignored, bool* stop) { |
| 628 | if (re->op() == kRegexpCapture && re->name() != NULL) { |
| 629 | // Allocate map once we find a name. |
| 630 | if (map_ == NULL) |
| 631 | map_ = new std::map<int, std::string>; |
| 632 | |
| 633 | (*map_)[re->cap()] = *re->name(); |
| 634 | } |
| 635 | return ignored; |
| 636 | } |
| 637 | |
| 638 | virtual Ignored ShortVisit(Regexp* re, Ignored ignored) { |
| 639 | // Should never be called: we use Walk(), not WalkExponential(). |