Mercurial > hg > Applications > Grep
comparison regexParser/threadedSearch.cc @ 318:c9458ffecb87
word mode in tSearch
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 08 May 2016 11:56:49 +0900 |
parents | 1188debbef10 |
children | 7b8234c090f7 |
comparison
equal
deleted
inserted
replaced
317:fa590a7272ae | 318:c9458ffecb87 |
---|---|
1 #include <stdio.h> | 1 #include <stdio.h> |
2 #include <stdlib.h> | 2 #include <stdlib.h> |
3 #include <string.h> | |
3 | 4 |
4 #include "regexParser.h" | 5 #include "regexParser.h" |
5 #include "CharClass.h" | 6 #include "CharClass.h" |
6 #include "threadedSearch.h" | 7 #include "threadedSearch.h" |
7 #include "subsetConstruction.h" | 8 #include "subsetConstruction.h" |
104 tsv = tsv.current->stateSkip(tsv); | 105 tsv = tsv.current->stateSkip(tsv); |
105 goto next; | 106 goto next; |
106 } else if (c<=ccv->end) { | 107 } else if (c<=ccv->end) { |
107 // range matched. | 108 // range matched. |
108 if (ccv->w.word) { | 109 if (ccv->w.word) { |
109 // match the word. | 110 WordPtr w; |
110 // if (not match) continue; | 111 for (w = &ccv->w;w;w = w->next) { |
112 // match the word. | |
113 if (strncmp((const char *)w->word,(const char *)tsv.buff.buffptr-1,w->length)==0) break; | |
114 } | |
115 if (!w) continue; // if (not match) continue; | |
116 tsv.buff.buffptr += w->length - 1; | |
111 } | 117 } |
112 if (ccv->tState) { | 118 if (ccv->tState) { |
113 tsv.current = ccv->tState; | 119 tsv.current = ccv->tState; |
114 } else { | 120 } else { |
115 tsv.current = nextTState(ccv->state,tsv.tg); | 121 tsv.current = nextTState(ccv->state,tsv.tg); |