diff regexParser/threadedSearch.cc @ 299:bdfe0a32c48f

grepWalk
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 03 Feb 2016 13:11:10 +0900
parents 63213964502a
children 1188debbef10
line wrap: on
line diff
--- a/regexParser/threadedSearch.cc	Wed Feb 03 12:24:34 2016 +0900
+++ b/regexParser/threadedSearch.cc	Wed Feb 03 13:11:10 2016 +0900
@@ -12,7 +12,6 @@
 
 static
 TSValue stateSkip(TSValue tsv) {
-    tsv.current = tsv.tg->stateStart->tState;
     if (tsv.matchEnd) {
         fwrite(tsv.matchBegin,tsv.matchEnd-tsv.matchBegin,1,stdout);
         puts("");
@@ -100,6 +99,7 @@
         for (int i = 0; i < tsv.current->ccvSize; i++) {
             CCVPtr ccv = &tsv.current->ccv[i];
             if (c<ccv->begin) {
+                tsv.current = tsv.tg->stateStart->tState;
                 tsv = tsv.current->stateSkip(tsv);
                 goto next;
             } else if (c<=ccv->end) {
@@ -117,6 +117,7 @@
                 goto next;
             }
         }
+        tsv.current = tsv.tg->stateStart->tState;
         tsv = tsv.current->stateSkip(tsv);
     }
 #if DEBUG