Finishes the regexp if necessary, preparing it for use in a more complex expression. If it is a CharClassBuilder, converts into a CharClass.
| 218 | // a more complex expression. |
| 219 | // If it is a CharClassBuilder, converts into a CharClass. |
| 220 | Regexp* Regexp::ParseState::FinishRegexp(Regexp* re) { |
| 221 | if (re == NULL) |
| 222 | return NULL; |
| 223 | re->down_ = NULL; |
| 224 | |
| 225 | if (re->op_ == kRegexpCharClass && re->ccb_ != NULL) { |
| 226 | CharClassBuilder* ccb = re->ccb_; |
| 227 | re->ccb_ = NULL; |
| 228 | re->cc_ = ccb->GetCharClass(); |
| 229 | delete ccb; |
| 230 | } |
| 231 | |
| 232 | return re; |
| 233 | } |
| 234 | |
| 235 | // Pushes the given regular expression onto the stack. |
| 236 | // Could check for too much memory used here. |
nothing calls this directly
no test coverage detected