changeset 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 fa590a7272ae
children 7b8234c090f7
files regexParser/threadedSearch.cc
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/regexParser/threadedSearch.cc	Sun May 08 11:40:38 2016 +0900
+++ b/regexParser/threadedSearch.cc	Sun May 08 11:56:49 2016 +0900
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "regexParser.h"
 #include "CharClass.h"
@@ -106,8 +107,13 @@
             } else if (c<=ccv->end) {
                 // range matched.
                 if (ccv->w.word) {
-                    // match the word.
-                    // if (not match) continue;
+                    WordPtr w;
+                    for (w = &ccv->w;w;w = w->next) {
+                        // match the word.
+                        if (strncmp((const char *)w->word,(const char *)tsv.buff.buffptr-1,w->length)==0) break;
+                    }
+                    if (!w) continue; // if (not match) continue;
+                    tsv.buff.buffptr += w->length - 1;
                 }
                 if (ccv->tState) {
                     tsv.current = ccv->tState;