]> granicus.if.org Git - onig/commitdiff
refactoring
authorK.Kosako <kkosako0@gmail.com>
Sat, 22 Sep 2018 12:25:04 +0000 (21:25 +0900)
committerK.Kosako <kkosako0@gmail.com>
Sat, 22 Sep 2018 12:25:04 +0000 (21:25 +0900)
src/regcomp.c
src/regexec.c
src/regint.h

index 08dc3d613d02b1308a712ac9ce4c02d8b74c1281..f25d1d56aecfcfe357713cacbc5313810a0d588b 100644 (file)
@@ -5583,7 +5583,7 @@ set_optimize_exact(regex_t* reg, OptExact* e)
       if (r != 0) return r;
 
       reg->optimize = (allow_reverse != 0
-                       ? OPTIMIZE_EXACT_BMH : OPTIMIZE_EXACT_BMH_FORWARD);
+                       ? OPTIMIZE_EXACT_BMH : OPTIMIZE_EXACT_BMH_STEP_FORWARD);
     }
     else {
       reg->optimize = OPTIMIZE_EXACT;
@@ -5809,7 +5809,7 @@ static void
 print_optimize_info(FILE* f, regex_t* reg)
 {
   static const char* on[] = { "NONE", "EXACT",
-                              "EXACT_BMH", "EXACT_BMH_FORWARD",
+                              "EXACT_BMH", "EXACT_BMH_STEP_FORWARD",
                               "EXACT_IC", "MAP" };
 
   fprintf(f, "optimize: %s\n", on[reg->optimize]);
index 48886bf58daf2a47973b733b9e5fe7bf2dd762b3..420e18d61263c929993494b95691d42ade9c3582 100644 (file)
@@ -4115,9 +4115,10 @@ slow_search_backward_ic(OnigEncoding enc, int case_fold_flag,
 #ifdef USE_SUNDAY_QUICK_SEARCH_ALGORITHM
 
 static UChar*
-bmh_search_forward(regex_t* reg, const UChar* target, const UChar* target_end,
-                   const UChar* text, const UChar* text_end,
-                   const UChar* text_range)
+bmh_search_step_forward(regex_t* reg,
+                        const UChar* target, const UChar* target_end,
+                        const UChar* text, const UChar* text_end,
+                        const UChar* text_range)
 {
   const UChar *s, *se, *t, *p, *end;
   const UChar *tail;
@@ -4125,7 +4126,7 @@ bmh_search_forward(regex_t* reg, const UChar* target, const UChar* target_end,
 
 #ifdef ONIG_DEBUG_SEARCH
   fprintf(stderr,
-          "bmh_search_forward: text: %p, text_end: %p, text_range: %p\n",
+          "bmh_search_step_forward: text: %p, text_end: %p, text_range: %p\n",
           text, text_end, text_range);
 #endif
 
@@ -4186,9 +4187,10 @@ bmh_search(regex_t* reg, const UChar* target, const UChar* target_end,
 #else
 
 static UChar*
-bmh_search_forward(regex_t* reg, const UChar* target, const UChar* target_end,
-                   const UChar* text, const UChar* text_end,
-                   const UChar* text_range)
+bmh_search_step_forward(regex_t* reg,
+                        const UChar* target, const UChar* target_end,
+                        const UChar* text, const UChar* text_end,
+                        const UChar* text_range)
 {
   const UChar *s, *se, *t, *p, *end;
   const UChar *tail;
@@ -4196,7 +4198,7 @@ bmh_search_forward(regex_t* reg, const UChar* target, const UChar* target_end,
 
 #ifdef ONIG_DEBUG_SEARCH
   fprintf(stderr,
-          "bmh_search_forward: text: %p, text_end: %p, text_range: %p\n",
+          "bmh_search_step_forward: text: %p, text_end: %p, text_range: %p\n",
           text, text_end, text_range);
 #endif
 
@@ -4370,8 +4372,9 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
     p = bmh_search(reg, reg->exact, reg->exact_end, p, end, range);
     break;
 
-  case OPTIMIZE_EXACT_BMH_FORWARD:
-    p = bmh_search_forward(reg, reg->exact, reg->exact_end, p, end, range);
+  case OPTIMIZE_EXACT_BMH_STEP_FORWARD:
+    p = bmh_search_step_forward(reg, reg->exact, reg->exact_end,
+                                p, end, range);
     break;
 
   case OPTIMIZE_MAP:
@@ -4493,7 +4496,7 @@ backward_search_range(regex_t* reg, const UChar* str, const UChar* end,
     break;
 
   case OPTIMIZE_EXACT_BMH:
-  case OPTIMIZE_EXACT_BMH_FORWARD:
+  case OPTIMIZE_EXACT_BMH_STEP_FORWARD:
     goto exact_method;
     break;
 
index 50a9e36afbe3914a9d38df9f91d523ff8f03e84c..b8950c08e20d579b77882477ee2d95b9fdef6d87 100644 (file)
@@ -317,12 +317,12 @@ enum StackPopLevel {
 
 /* optimize flags */
 enum OptimizeType {
-  OPTIMIZE_NONE              = 0,
-  OPTIMIZE_EXACT             = 1,  /* Slow Search */
-  OPTIMIZE_EXACT_BMH         = 2,  /* Boyer-Moore-Horspool */
-  OPTIMIZE_EXACT_BMH_FORWARD = 3,  /* Boyer-Moore-Horspool (forward) */
-  OPTIMIZE_EXACT_IC          = 4,  /* Slow Search (ignore case) */
-  OPTIMIZE_MAP               = 5   /* char map */
+  OPTIMIZE_NONE                   = 0,
+  OPTIMIZE_EXACT                  = 1,  /* Slow Search */
+  OPTIMIZE_EXACT_BMH              = 2,  /* Boyer-Moore-Horspool */
+  OPTIMIZE_EXACT_BMH_STEP_FORWARD = 3,  /* Boyer-Moore-Horspool */
+  OPTIMIZE_EXACT_IC               = 4,  /* Slow Search (ignore case) */
+  OPTIMIZE_MAP                    = 5   /* char map */
 };
 
 /* bit status */