]> granicus.if.org Git - onig/commitdiff
change (*COUNT{}) argument from p/s/f to space/+/-
authorK.Kosako <kosako@sofnec.co.jp>
Tue, 6 Mar 2018 01:50:54 +0000 (10:50 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Tue, 6 Mar 2018 01:50:54 +0000 (10:50 +0900)
sample/count.c
src/ascii.c
src/regexec.c
src/utf16_be.c
src/utf16_le.c

index 8b9fff548708a04abb4fb3f8e16adc44953ab46f..272d64a28881c77cf2d3a3f5efe4b3f8ceb098f9 100644 (file)
@@ -110,9 +110,9 @@ extern int main(int argc, char* argv[])
   test(encs[0], mp, "abc(.(*COUNT[x]))*(*FAIL)", "abcdefg");
   test(encs[0], mp, "abc(.(*COUNT[_any_]))*(.(*COUNT[x]))*d", "abcdefg");
   /* fail count */
-  test(encs[0], mp, "abc(.(*COUNT[x]{f}))*f", "abcdefg");
+  test(encs[0], mp, "abc(.(*COUNT[x]{-}))*f", "abcdefg");
   /* success count */
-  test(encs[0], mp, "abc(.(*COUNT[x]{s}))*f", "abcdefg");
+  test(encs[0], mp, "abc(.(*COUNT[x]{+}))*f", "abcdefg");
   /* passed count */
   test(encs[0], mp, "abc(.(*COUNT[x]))*f", "abcdefg");
   test(encs[0], mp, "a(.(*COUNT[x]))*z", "abcd\nabcdz");
index ddd1ba4c41a58905b14c3a1469ca633b32a89773..6050aa752426e19c29ed24f3cd9874a52d2536f5 100644 (file)
@@ -50,10 +50,10 @@ init(void)
     name = "ERROR";       BC1_P(name, error, &t_long);
     name = "MAX";         BC1_B(name, max, &t_long);
     name = "COUNT";
-    args[0] = ONIG_TYPE_CHAR; opts[0].c = 'p';
+    args[0] = ONIG_TYPE_CHAR; opts[0].c = ' ';
     BC_B_O(name, count, 1, args, 1, opts);
     name = "TOTAL_COUNT";
-    args[0] = ONIG_TYPE_CHAR; opts[0].c = 'p';
+    args[0] = ONIG_TYPE_CHAR; opts[0].c = ' ';
     BC_B_O(name, total_count, 1, args, 1, opts);
 
 #endif /* USE_CALLOUT */
index 2dbdee74bded92d78a255e0986c75e31ccc18a6c..cdad343766d330d5a1a46b8b9ab926c159787461 100644 (file)
@@ -5307,7 +5307,7 @@ onig_builtin_total_count(OnigCalloutArgs* args, void* user_data ARG_UNUSED)
   if (r != ONIG_NORMAL) return r;
 
   count_type = aval.c;
-  if (count_type != 'p' && count_type != 's' && count_type != 'f')
+  if (count_type != ' ' && count_type != '+' && count_type != '-')
     return ONIGERR_INVALID_CALLOUT_ARG;
 
   slot = 0;
@@ -5322,13 +5322,13 @@ onig_builtin_total_count(OnigCalloutArgs* args, void* user_data ARG_UNUSED)
   }
 
   if (args->in == ONIG_CALLOUT_IN_RETRACTION) {
-    if (count_type == 'f')
+    if (count_type == '-')
       val.l++;
-    else if (count_type == 's')
+    else if (count_type == '+')
       val.l--;
   }
   else {
-    if (count_type != 'f')
+    if (count_type != '-')
       val.l++;
   }
 
index 3340d92705a724bb8716c2810a63f39eec785b30..5a949fcb761c16cd1e1a842e7c21582e5b5d1a53 100644 (file)
@@ -52,10 +52,10 @@ init(void)
     name = "\000M\000A\000X\000\000";                    BC1_B(name, max, &t_long);
 
     name = "\000C\000O\000U\000N\000T\000\000";
-    args[0] = ONIG_TYPE_CHAR; opts[0].c = 'p';
+    args[0] = ONIG_TYPE_CHAR; opts[0].c = ' ';
     BC_B_O(name, count, 1, args, 1, opts);
     name = "\000T\000O\000T\000A\000L\000_\000C\000O\000U\000N\000T\000\000";
-    args[0] = ONIG_TYPE_CHAR; opts[0].c = 'p';
+    args[0] = ONIG_TYPE_CHAR; opts[0].c = ' ';
     BC_B_O(name, total_count, 1, args, 1, opts);
 
 #endif /* USE_CALLOUT */
index d0a733d6ad210eec71dc0f7ea199a30173618553..fbad0620d5f61d24a8c14cbc724b70de8b5f2b81 100644 (file)
@@ -50,10 +50,10 @@ init(void)
     name = "M\000A\000X\000\000\000";                    BC1_B(name, max, &t_long);
 
     name = "C\000O\000U\000N\000T\000\000\000";
-    args[0] = ONIG_TYPE_CHAR; opts[0].c = 'p';
+    args[0] = ONIG_TYPE_CHAR; opts[0].c = ' ';
     BC_B_O(name, count, 1, args, 1, opts);
     name = "T\000O\000T\000A\000L\000_\000C\000O\000U\000N\000T\000\000\000";
-    args[0] = ONIG_TYPE_CHAR; opts[0].c = 'p';
+    args[0] = ONIG_TYPE_CHAR; opts[0].c = ' ';
     BC_B_O(name, total_count, 1, args, 1, opts);
 
 #endif /* USE_CALLOUT */