# HG changeset patch # User mir3636 # Date 1462616323 -32400 # Node ID 66012db6a717c67666e390c6cfcf6905bfc18bdd # Parent a4484c02cba56c0231a6e1d940c73f345a9fb7b9 add wordMode in grepWalk diff -r a4484c02cba5 -r 66012db6a717 regexParser/CharClass.cc --- a/regexParser/CharClass.cc Sat May 07 18:38:54 2016 +0900 +++ b/regexParser/CharClass.cc Sat May 07 19:18:43 2016 +0900 @@ -47,17 +47,10 @@ return ncc; } if (m->cond.w.word) { - WordPtr w = &m->cond.w; - WordPtr *next = &ncc->cond.w.next; - while(w->next) { // insert sort? - WordPtr n = NEW(Word); - n->word = w->word; - n->length = w->length; - *next = n; - next = &n->next; - w = w->next; - } - *next = &m->cond.w; + WordPtr n = &ncc->cond.w; + n->word = m->cond.w.word; + n->length = m->cond.w.length; + n->next = &cc->cond.w; } ncc->nextState.bitContainer = m->nextState.bitContainer | cc->nextState.bitContainer; return ncc; diff -r a4484c02cba5 -r 66012db6a717 regexParser/grepWalk.cc --- a/regexParser/grepWalk.cc Sat May 07 18:38:54 2016 +0900 +++ b/regexParser/grepWalk.cc Sat May 07 19:18:43 2016 +0900 @@ -49,8 +49,14 @@ } else if (c<=cc->cond.range.end) { // range matched. if (cc->cond.w.word) { - // match the word. - // if (not match) continue; + WordPtr w; + for (w = &cc->cond.w.word;w;w = w->next) { + // match the word. + // if (not match) continue; + if (strncmp(w.word,tsv.buff.buffptr-1,w.length)) break; + } + if (!w) continue; + tsv.buff.buffptr += w.length - 1; } state = nextState(cc->nextState,tg); goto next;