- found:
- current= current->links[i].then;
- if (current->s[0]) {
- fprintf(debug," \"%s\"",current->s);
- bestmatch=current; bestmatch_rx=x;
- } else {
- fprintf(debug," ...");
+ x= lx;
+ if (!(ctxmap & (1u << ctxi))) continue;
+ fprintf(debug," || %s",context_names[ctxi]);
+
+ for (;;) {
+ debug_flush();
+ fprintf(debug," | x=%d",x);
+ if (x>w) break;
+ Pixcol cv= cols[x];
+ fprintf(debug," cv=%"PSPIXCOL(PRIx),cv);
+ for (i=0; i<current->nlinks; i++)
+ if (current->links[i].col == cv)
+ goto found;
+ /* not found */
+ fprintf(debug," ?");
+ break;
+
+ found:
+ current= current->links[i].then;
+ if (current->s[0]) {
+ fprintf(debug," \"%s\"",current->s);
+ bestmatch= current;
+ bestmatch_rx= x;
+ } else {
+ fprintf(debug," ...");
+ }
+
+ x++;
+ }
+
+ if (bestmatch) {
+ if (uniquematch && strcmp(bestmatch->s, uniquematch->s)) {
+ fprintf(debug, " ambiguous");
+ uniquematch= 0;
+ break;
+ }
+ uniquematch= bestmatch;
+ uniquematch_rx= bestmatch_rx;