Lines Matching refs:depth

210 static void go_deeper(trystate_T *stack, int depth, int score_add);
1207 #define TRY_DEEPER(su, stack, depth, add) \ argument
1208 (stack[depth].ts_score + (add) < su->su_maxscore)
1261 int depth; in suggest_trie_walk() local
1286 depth = 0; in suggest_trie_walk()
1330 while (depth >= 0 && !got_int) in suggest_trie_walk()
1332 sp = &stack[depth]; in suggest_trie_walk()
1370 sprintf(changename[depth], "prefix"); in suggest_trie_walk()
1372 go_deeper(stack, depth, 0); in suggest_trie_walk()
1373 ++depth; in suggest_trie_walk()
1374 sp = &stack[depth]; in suggest_trie_walk()
1375 sp->ts_prefixdepth = depth - 1; in suggest_trie_walk()
1606 for (j = 0; j < depth; ++j) in suggest_trie_walk()
1764 if (TRY_DEEPER(su, stack, depth, newscore)) in suggest_trie_walk()
1766 go_deeper(stack, depth, newscore); in suggest_trie_walk()
1769 sprintf(changename[depth], "%.*s-%s: split", in suggest_trie_walk()
1772 sprintf(changename[depth], "%.*s-%s: compound", in suggest_trie_walk()
1780 ++depth; in suggest_trie_walk()
1781 sp = &stack[depth]; in suggest_trie_walk()
1913 && TRY_DEEPER(su, stack, depth, newscore)) in suggest_trie_walk()
1915 go_deeper(stack, depth, newscore); in suggest_trie_walk()
1918 sprintf(changename[depth], "%.*s-%s: subst %c to %c", in suggest_trie_walk()
1922 sprintf(changename[depth], "%.*s-%s: accept %c", in suggest_trie_walk()
1926 ++depth; in suggest_trie_walk()
1927 sp = &stack[depth]; in suggest_trie_walk()
2053 && TRY_DEEPER(su, stack, depth, newscore)) in suggest_trie_walk()
2055 go_deeper(stack, depth, newscore); in suggest_trie_walk()
2057 sprintf(changename[depth], "%.*s-%s: delete %c", in suggest_trie_walk()
2061 ++depth; in suggest_trie_walk()
2065 stack[depth].ts_flags |= TSF_DIDDEL; in suggest_trie_walk()
2066 stack[depth].ts_delidx = sp->ts_fidx; in suggest_trie_walk()
2075 stack[depth].ts_fidx += mb_ptr2len(fword + sp->ts_fidx); in suggest_trie_walk()
2077 stack[depth].ts_score -= SCORE_DEL - SCORE_DELCOMP; in suggest_trie_walk()
2078 else if (c == mb_ptr2char(fword + stack[depth].ts_fidx)) in suggest_trie_walk()
2079 stack[depth].ts_score -= SCORE_DEL - SCORE_DELDUP; in suggest_trie_walk()
2083 ++stack[depth].ts_fidx; in suggest_trie_walk()
2085 stack[depth].ts_score -= SCORE_DEL - SCORE_DELDUP; in suggest_trie_walk()
2150 && TRY_DEEPER(su, stack, depth, newscore)) in suggest_trie_walk()
2152 go_deeper(stack, depth, newscore); in suggest_trie_walk()
2154 sprintf(changename[depth], "%.*s-%s: insert %c", in suggest_trie_walk()
2158 ++depth; in suggest_trie_walk()
2159 sp = &stack[depth]; in suggest_trie_walk()
2250 if (c2 != NUL && TRY_DEEPER(su, stack, depth, SCORE_SWAP)) in suggest_trie_walk()
2252 go_deeper(stack, depth, SCORE_SWAP); in suggest_trie_walk()
2254 sprintf(changename[depth], "%.*s-%s: swap %c and %c", in suggest_trie_walk()
2260 ++depth; in suggest_trie_walk()
2266 stack[depth].ts_fidxtry = sp->ts_fidx + n + fl; in suggest_trie_walk()
2272 stack[depth].ts_fidxtry = sp->ts_fidx + 2; in suggest_trie_walk()
2338 if (TRY_DEEPER(su, stack, depth, SCORE_SWAP3)) in suggest_trie_walk()
2340 go_deeper(stack, depth, SCORE_SWAP3); in suggest_trie_walk()
2342 sprintf(changename[depth], "%.*s-%s: swap3 %c and %c", in suggest_trie_walk()
2348 ++depth; in suggest_trie_walk()
2355 stack[depth].ts_fidxtry = sp->ts_fidx + n + fl + tl; in suggest_trie_walk()
2361 stack[depth].ts_fidxtry = sp->ts_fidx + 3; in suggest_trie_walk()
2405 if (TRY_DEEPER(su, stack, depth, SCORE_SWAP3)) in suggest_trie_walk()
2407 go_deeper(stack, depth, SCORE_SWAP3); in suggest_trie_walk()
2410 sprintf(changename[depth], "%.*s-%s: rotate left %c%c%c", in suggest_trie_walk()
2416 ++depth; in suggest_trie_walk()
2426 stack[depth].ts_fidxtry = sp->ts_fidx + n + fl; in suggest_trie_walk()
2434 stack[depth].ts_fidxtry = sp->ts_fidx + 3; in suggest_trie_walk()
2466 if (TRY_DEEPER(su, stack, depth, SCORE_SWAP3)) in suggest_trie_walk()
2468 go_deeper(stack, depth, SCORE_SWAP3); in suggest_trie_walk()
2471 sprintf(changename[depth], "%.*s-%s: rotate right %c%c%c", in suggest_trie_walk()
2477 ++depth; in suggest_trie_walk()
2487 stack[depth].ts_fidxtry = sp->ts_fidx + n + tl; in suggest_trie_walk()
2495 stack[depth].ts_fidxtry = sp->ts_fidx + 3; in suggest_trie_walk()
2579 && TRY_DEEPER(su, stack, depth, SCORE_REP)) in suggest_trie_walk()
2581 go_deeper(stack, depth, SCORE_REP); in suggest_trie_walk()
2583 sprintf(changename[depth], "%.*s-%s: replace %s with %s", in suggest_trie_walk()
2592 ++depth; in suggest_trie_walk()
2601 stack[depth].ts_fidxtry = sp->ts_fidx + tl; in suggest_trie_walk()
2602 stack[depth].ts_tcharlen = 0; in suggest_trie_walk()
2638 --depth; in suggest_trie_walk()
2640 if (depth >= 0 && stack[depth].ts_prefixdepth == PFD_PREFIXTREE) in suggest_trie_walk()
2662 go_deeper(trystate_T *stack, int depth, int score_add) in go_deeper() argument
2664 stack[depth + 1] = stack[depth]; in go_deeper()
2665 stack[depth + 1].ts_state = STATE_START; in go_deeper()
2666 stack[depth + 1].ts_score = stack[depth].ts_score + score_add; in go_deeper()
2667 stack[depth + 1].ts_curi = 1; // start just after length byte in go_deeper()
2668 stack[depth + 1].ts_flags = 0; in go_deeper()
2681 int depth; in find_keepcap_word() local
2713 depth = 0; in find_keepcap_word()
2719 while (depth >= 0) in find_keepcap_word()
2721 if (fword[fwordidx[depth]] == NUL) in find_keepcap_word()
2725 if (byts[arridx[depth] + 1] == 0) in find_keepcap_word()
2727 kword[kwordlen[depth]] = NUL; in find_keepcap_word()
2732 --depth; in find_keepcap_word()
2734 else if (++round[depth] > 2) in find_keepcap_word()
2738 --depth; in find_keepcap_word()
2746 flen = MB_CPTR2LEN(fword + fwordidx[depth]); in find_keepcap_word()
2747 ulen = MB_CPTR2LEN(uword + uwordidx[depth]); in find_keepcap_word()
2751 if (round[depth] == 1) in find_keepcap_word()
2753 p = fword + fwordidx[depth]; in find_keepcap_word()
2758 p = uword + uwordidx[depth]; in find_keepcap_word()
2762 for (tryidx = arridx[depth]; l > 0; --l) in find_keepcap_word()
2795 if (round[depth] == 1) in find_keepcap_word()
2797 STRNCPY(kword + kwordlen[depth], fword + fwordidx[depth], in find_keepcap_word()
2799 kwordlen[depth + 1] = kwordlen[depth] + flen; in find_keepcap_word()
2803 STRNCPY(kword + kwordlen[depth], uword + uwordidx[depth], in find_keepcap_word()
2805 kwordlen[depth + 1] = kwordlen[depth] + ulen; in find_keepcap_word()
2807 fwordidx[depth + 1] = fwordidx[depth] + flen; in find_keepcap_word()
2808 uwordidx[depth + 1] = uwordidx[depth] + ulen; in find_keepcap_word()
2810 ++depth; in find_keepcap_word()
2811 arridx[depth] = tryidx; in find_keepcap_word()
2812 round[depth] = 0; in find_keepcap_word()