Lines Matching refs:re
237 #define matchpush(e,x) ((x)->re.group.number?_matchpush(e,x):0)
238 #define matchcopy(e,x) do if ((x)->re.group.number) { Match_frame_t* fp = (void*)stkframe(stkstd)->data; memcpy(fp->match, fp->save, fp->size); } while (0)
239 #define matchpop(e,x) do if ((x)->re.group.number) { Match_frame_t* fp = (void*)stkframe(stkstd)->data; memcpy(fp->match, fp->save, fp->size); stkpop(stkstd); } while (0)
256 if (rex->re.group.number <= 0 || (num = rex->re.group.last - rex->re.group.number + 1) <= 0)
264 f->match = m = env->match + rex->re.group.number;
408 DEBUG_TEST(0x0010,(sfprintf(sfstdout, "AHA#%04d 0x%04x parserep %s %d %d %d %d `%-.*s'\n", __LINE__, debug_flag, rexname(rex->re.group.expr.rex), rex->re.group.number, rex->lo, n, rex->hi, env->end - s, s)),(0));
431 catcher.re.rep_catch.ref = rex;
432 catcher.re.rep_catch.cont = cont;
433 catcher.re.rep_catch.beg = s;
434 catcher.re.rep_catch.n = n + 1;
437 rex->re.rep_catch.beg = s;
444 DEBUG_TEST(0x0004,(sfprintf(sfstdout,"AHA#%04d 0x%04x PUSH %d (%d,%d)(%d,%d)(%d,%d) (%d,%d)(%d,%d)(%d,%d)\n", __LINE__, debug_flag, rex->re.group.number, env->best[0].rm_so, env->best[0].rm_eo, env->best[1].rm_so, env->best[1].rm_eo, env->best[2].rm_so, env->best[2].rm_eo, env->match[0].rm_so, env->match[0].rm_eo, env->match[1].rm_so, env->match[1].rm_eo, env->match[2].rm_so, env->match[2].rm_eo)),(0));
446 r = parse(env, rex->re.group.expr.rex, &catcher, s);
447 DEBUG_TEST(0x0010,(sfprintf(sfstdout, "AHA#%04d 0x%04x parserep parse %d %d `%-.*s'\n", __LINE__, debug_flag, rex->re.group.number, r, env->end - s, s)),(0));
452 DEBUG_TEST(0x0004,(sfprintf(sfstdout,"AHA#%04d 0x%04x POP %d %d (%d,%d)(%d,%d)(%d,%d) (%d,%d)(%d,%d)(%d,%d)\n", __LINE__, debug_flag, rex->re.group.number, r, env->best[0].rm_so, env->best[0].rm_eo, env->best[1].rm_so, env->best[1].rm_eo, env->best[2].rm_so, env->best[2].rm_eo, env->match[0].rm_so, env->match[0].rm_eo, env->match[1].rm_so, env->match[1].rm_eo, env->match[2].rm_so, env->match[2].rm_eo)),(0));
707 if (ic ? collic(rex->re.collate.elements, (char*)key, (char*)key, c, x) : collelt(rex->re.collate.elements, (char*)key, c, x))
718 return rex->re.collate.invert ? !r : r;
831 catcher.re.alt_catch.cont = cont;
833 r = parse(env, rex->re.group.expr.binary.left, &catcher, s);
837 ((Pos_t*)env->pos->vec + env->pos->cur - 1)->serial = catcher.serial = rex->re.group.expr.binary.serial;
838 n = parse(env, rex->re.group.expr.binary.right, &catcher, s);
847 if ((r = parse(env, rex->re.group.expr.binary.left, cont, s)) == NONE)
848 r = parse(env, rex->re.group.expr.binary.right, cont, s);
856 r = follow(env, rex, rex->re.alt_catch.cont, s);
908 if (!settst(rex->re.charclass, s[i]))
930 if (!settst(rex->re.charclass, *s))
945 if (s >= e || !settst(rex->re.charclass, *s))
1016 next.re.conj_right.cont = cont;
1019 catcher.re.conj_left.right = rex->re.group.expr.binary.right;
1020 catcher.re.conj_left.cont = &next;
1021 catcher.re.conj_left.beg = s;
1023 return parse(env, rex->re.group.expr.binary.left, &catcher, s);
1025 rex->re.conj_left.cont->re.conj_right.end = s;
1026 cont = rex->re.conj_left.cont;
1027 s = rex->re.conj_left.beg;
1028 rex = rex->re.conj_left.right;
1031 if (rex->re.conj_right.end != s)
1033 cont = rex->re.conj_right.cont;
1182 if (rex->re.group.number)
1183 env->match[rex->re.group.number].rm_so = s - env->beg;
1186 catcher.re.group_catch.eo = rex->re.group.number ? &env->match[rex->re.group.number].rm_eo : (regoff_t*)0;
1190 catcher.re.group_catch.cont = cont;
1192 r = parse(env, rex->re.group.expr.rex, &catcher, s);
1196 if (rex->re.group.number)
1197 env->match[rex->re.group.number].rm_so = -1;
1201 DEBUG_TEST(0x0200,(sfprintf(sfstdout,"AHA#%04d 0x%04x parse %s=>%s `%-.*s'\n", __LINE__, debug_flag, rexname(rex), rexname(rex->re.group_catch.cont), env->end - s, s)),(0));
1204 if (rex->re.group_catch.eo)
1205 *rex->re.group_catch.eo = s - env->beg;
1209 r = follow(env, rex, rex->re.group_catch.cont, s);
1213 if (rex->re.group_catch.eo)
1214 *rex->re.group_catch.eo = -1;
1221 catcher.re.rep_catch.beg = s;
1222 catcher.re.rep_catch.cont = cont;
1224 return parse(env, rex->re.group.expr.rex, &catcher, s);
1226 return follow(env, rex, rex->re.rep_catch.cont, rex->re.rep_catch.beg);
1228 r = parse(env, rex->re.group.expr.rex, NiL, s);
1235 if ((s - env->beg) < rex->re.group.size)
1240 catcher.re.behind_catch.beg = s;
1241 catcher.re.behind_catch.end = e = env->end;
1242 catcher.re.behind_catch.cont = cont;
1244 for (t = s - rex->re.group.size; t >= env->beg; t--)
1247 r = parse(env, rex->re.group.expr.rex, &catcher, t);
1254 if (s != rex->re.behind_catch.beg)
1256 env->end = rex->re.behind_catch.end;
1257 return follow(env, rex, rex->re.behind_catch.cont, rex->re.behind_catch.beg);
1259 if ((s - env->beg) < rex->re.group.size)
1264 catcher.re.neg_catch.beg = s;
1268 for (t = s - rex->re.group.size; t >= env->beg; t--)
1270 r = parse(env, rex->re.group.expr.rex, &catcher, t);
1282 return s == rex->re.neg_catch.beg ? GOOD : NONE;
1284 if (q = rex->re.group.expr.binary.right)
1286 catcher.re.cond_catch.next[0] = q->re.group.expr.binary.right;
1287 catcher.re.cond_catch.next[1] = q->re.group.expr.binary.left;
1290 catcher.re.cond_catch.next[0] = catcher.re.cond_catch.next[1] = 0;
1291 if (q = rex->re.group.expr.binary.left)
1296 catcher.re.cond_catch.yes = 0;
1297 catcher.re.cond_catch.beg = s;
1298 catcher.re.cond_catch.cont = cont;
1301 if (r == BAD || catcher.re.cond_catch.yes)
1304 else if (!rex->re.group.size || rex->re.group.size > 0 && env->match[rex->re.group.size].rm_so >= 0)
1308 if (q = catcher.re.cond_catch.next[r != NONE])
1313 catcher.re.group_catch.cont = cont;
1319 rex->re.cond_catch.yes = 1;
1323 catcher.re.group_catch.cont = rex->re.cond_catch.cont;
1325 return parse(env, rex->re.cond_catch.next[1], &catcher, rex->re.cond_catch.beg);
1327 return follow(env, rex, rex->re.group_catch.cont, s);
1332 catcher.re.group_catch.cont = cont;
1334 return parse(env, rex->re.group.expr.rex, &catcher, s);
1336 switch (r = follow(env, rex, rex->re.group_catch.cont, s))
1347 f = rex->re.string.fail;
1348 b = rex->re.string.base;
1349 n = rex->re.string.size;
1421 catcher.re.neg_catch.beg = s;
1424 memset(catcher.re.neg_catch.index = p, 0, n);
1426 if (parse(env, rex->re.group.expr.rex, &catcher, s) == BAD)
1457 bitset(rex->re.neg_catch.index, s - rex->re.neg_catch.beg);
1464 if ((c = *s++) == rex->re.nest.primary)
1466 if (s >= env->end || !(s = nestmatch(s, env->end, rex->re.nest.type, c)))
1470 if (rex->re.nest.primary >= 0)
1472 if (rex->re.nest.type[c] & (REX_NEST_delimiter|REX_NEST_separator|REX_NEST_terminator))
1474 if (!(s = nestmatch(s, env->end, rex->re.nest.type, c)))
1476 } while (s < env->end && !(rex->re.nest.type[*(s-1)] & (REX_NEST_delimiter|REX_NEST_separator|REX_NEST_terminator)));
1488 c = rex->re.onechar;
1677 DEBUG_TEST(0x0020,(sfprintf(sfstdout, "AHA#%04d 0x%04x %s n %d len %d s `%-.*s'\n", __LINE__, debug_flag, rexname(rex), rex->re.rep_catch.n, s - rex->re.rep_catch.beg, env->end - s, s)),(0));
1680 if (s == rex->re.rep_catch.beg && rex->re.rep_catch.n > rex->re.rep_catch.ref->lo)
1686 DEBUG_TEST(0x0002,(sfprintf(sfstdout, "AHA#%04d %p re.group.back=%d re.group.expr.rex=%s\n", __LINE__, rex->re.rep_catch.ref->re.group.expr.rex, rex->re.rep_catch.ref->re.group.expr.rex->re.group.back, rexname(rex->re.rep_catch.ref->re.group.expr.rex))),(0));
1687 if (!env->stack || s != rex->re.rep_catch.ref->re.rep_catch.beg && !rex->re.rep_catch.ref->re.group.expr.rex->re.group.back)
1693 r = follow(env, rex, rex->re.rep_catch.cont, s);
1698 r = parserep(env, rex->re.rep_catch.ref, rex->re.rep_catch.cont, s, rex->re.rep_catch.n);
1703 DEBUG_TEST(0x0200,(sfprintf(sfstdout,"AHA#%04d 0x%04x parse %s \"%-.*s\" `%-.*s'\n", __LINE__, debug_flag, rexname(rex), rex->re.string.size, rex->re.string.base, env->end - s, s)),(0));
1704 if (rex->re.string.size > (env->end - s))
1706 t = rex->re.string.base;
1707 e = t + rex->re.string.size;
1732 if (((s + rex->re.trie.min) > env->end) || !(x = rex->re.trie.root[rex->map ? rex->map[*s] : *s]))
1737 r = (*env->disc->re_execf)(env->regex, rex->re.exec.data, rex->re.exec.text, rex->re.exec.size, (const char*)s, env->end - s, &u, env->disc);
1810 listnode(e->re.group.expr.binary.left, level + 1);
1811 listnode(e->re.group.expr.binary.right, level + 1);
1821 listnode(e->re.group.expr.rex, level + 1);
1898 if (len < e->re.bm.right)
1900 DEBUG_TEST(0x0080,(sfprintf(sfstdout, "AHA#%04d REG_NOMATCH %d %d\n", __LINE__, len, e->re.bm.right)),(0));
1906 register size_t index = e->re.bm.left + e->re.bm.size;
1907 register size_t mid = len - e->re.bm.right;
1908 register size_t* skip = e->re.bm.skip;
1909 register size_t* fail = e->re.bm.fail;
1910 register Bm_mask_t** mask = e->re.bm.mask;
1914 DEBUG_TEST(0x0080,(sfprintf(sfstdout, "AHA#%04d REX_BM len=%d right=%d left=%d size=%d %d %d\n", __LINE__, len, e->re.bm.right, e->re.bm.left, e->re.bm.size, index, mid)),(0));
1924 m = mask[n = e->re.bm.size - 1][buf[index]];
1929 if (e->re.bm.back < 0)
1933 i = index - e->re.bm.back;
1940 if (index < e->re.bm.back)
1943 index -= e->re.bm.back;
1955 index += e->re.bm.size;