| 169 | } |
| 170 | |
| 171 | void Regexp::AddRuneToString(Rune r) { |
| 172 | DCHECK(op_ == kRegexpLiteralString); |
| 173 | if (nrunes_ == 0) { |
| 174 | // start with 8 |
| 175 | runes_ = new Rune[8]; |
| 176 | } else if (nrunes_ >= 8 && (nrunes_ & (nrunes_ - 1)) == 0) { |
| 177 | // double on powers of two |
| 178 | Rune *old = runes_; |
| 179 | runes_ = new Rune[nrunes_ * 2]; |
| 180 | for (int i = 0; i < nrunes_; i++) |
| 181 | runes_[i] = old[i]; |
| 182 | delete[] old; |
| 183 | } |
| 184 | |
| 185 | runes_[nrunes_++] = r; |
| 186 | } |
| 187 | |
| 188 | Regexp* Regexp::HaveMatch(int match_id, ParseFlags flags) { |
| 189 | Regexp* re = new Regexp(kRegexpHaveMatch, flags); |
no outgoing calls
no test coverage detected