Lines Matching defs:sub

29 // Can't call Decref on the sub-Regexps here because
137 Regexp** subs = re->sub();
139 Regexp* sub = subs[i];
140 if (sub == NULL)
142 if (sub->ref_ == kMaxRef)
143 sub->Decref();
145 --sub->ref_;
146 if (sub->ref_ == 0 && !sub->QuickDestroy()) {
147 sub->down_ = stack;
148 stack = sub;
182 Regexp* Regexp::Plus(Regexp* sub, ParseFlags flags) {
183 if (sub->op() == kRegexpPlus && sub->parse_flags() == flags)
184 return sub;
187 re->sub()[0] = sub;
191 Regexp* Regexp::Star(Regexp* sub, ParseFlags flags) {
192 if (sub->op() == kRegexpStar && sub->parse_flags() == flags)
193 return sub;
196 re->sub()[0] = sub;
200 Regexp* Regexp::Quest(Regexp* sub, ParseFlags flags) {
201 if (sub->op() == kRegexpQuest && sub->parse_flags() == flags)
202 return sub;
205 re->sub()[0] = sub;
209 Regexp* Regexp::ConcatOrAlternate(RegexpOp op, Regexp** sub, int nsub,
212 return sub[0];
216 // Going to edit sub; make a copy so we don't step on caller.
218 memmove(subcopy, sub, nsub * sizeof sub[0]);
219 sub = subcopy;
220 nsub = FactorAlternation(sub, nsub, flags);
222 Regexp* re = sub[0];
234 Regexp** subs = re->sub();
236 subs[i] = ConcatOrAlternate(op, sub+i*kMaxNsub, kMaxNsub, flags, false);
237 subs[nbigsub - 1] = ConcatOrAlternate(op, sub+(nbigsub-1)*kMaxNsub,
246 Regexp** subs = re->sub();
248 subs[i] = sub[i];
254 Regexp* Regexp::Concat(Regexp** sub, int nsub, ParseFlags flags) {
255 return ConcatOrAlternate(kRegexpConcat, sub, nsub, flags, false);
258 Regexp* Regexp::Alternate(Regexp** sub, int nsub, ParseFlags flags) {
259 return ConcatOrAlternate(kRegexpAlternate, sub, nsub, flags, true);
262 Regexp* Regexp::AlternateNoFactor(Regexp** sub, int nsub, ParseFlags flags) {
263 return ConcatOrAlternate(kRegexpAlternate, sub, nsub, flags, false);
266 Regexp* Regexp::Capture(Regexp* sub, ParseFlags flags, int cap) {
269 re->sub()[0] = sub;
274 Regexp* Regexp::Repeat(Regexp* sub, ParseFlags flags, int min, int max) {
277 re->sub()[0] = sub;
420 a2 = a->sub()[i];
421 b2 = b->sub()[i];
434 a2 = a->sub()[0];
435 b2 = b->sub()[0];
630 Regexp** sub = this->sub();
631 while (i < nsub_ && sub[i]->op_ == kRegexpBeginText)
636 Regexp* re = sub[i];
672 *foldcase = (sub[i]->parse_flags() & FoldCase);
678 sub[j]->Incref();
679 re = Concat(sub + i, nsub_ - i, parse_flags());