]> granicus.if.org Git - onig/commitdiff
remove GIMMICK_KEEP from GimmickType
authorK.Kosako <kkosako0@gmail.com>
Wed, 20 Feb 2019 05:02:07 +0000 (14:02 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Thu, 28 Feb 2019 05:28:18 +0000 (14:28 +0900)
src/regcomp.c
src/regparse.h

index f53771a391a2818454dbf8ab0ed47f680bca0698..31f3760cd91a4c9c675f432a4e0633a9ef2fcae5 100644 (file)
@@ -1496,13 +1496,6 @@ compile_gimmick_node(GimmickNode* node, regex_t* reg)
     r = add_op(reg, OP_FAIL);
     break;
 
-  case GIMMICK_KEEP:
-    r = add_op(reg, OP_PUSH_SAVE_VAL);
-    if (r != 0) return r;
-    COP(reg)->push_save_val.type = SAVE_KEEP;
-    COP(reg)->push_save_val.id   = node->id;
-    break;
-
   case GIMMICK_SAVE:
     r = add_op(reg, OP_PUSH_SAVE_VAL);
     if (r != 0) return r;
@@ -1557,7 +1550,6 @@ compile_length_gimmick_node(GimmickNode* node, regex_t* reg)
     len = SIZE_OP_FAIL;
     break;
 
-  case GIMMICK_KEEP:
   case GIMMICK_SAVE:
     len = SIZE_OP_PUSH_SAVE_VAL;
     break;
@@ -6722,9 +6714,6 @@ print_indent_tree(FILE* f, Node* node, int indent)
     case GIMMICK_FAIL:
       fprintf(f, "fail");
       break;
-    case GIMMICK_KEEP:
-      fprintf(f, "keep:%d", GIMMICK_(node)->id);
-      break;
     case GIMMICK_SAVE:
       fprintf(f, "save:%d:%d", GIMMICK_(node)->detail_type, GIMMICK_(node)->id);
       break;
index 6cfac58c0bd554b5846ccc91aeba3995923e962f..5818c541d2e21615ea9ef6bec8e494c2a75932e1 100644 (file)
@@ -59,11 +59,10 @@ enum BagType {
 
 enum GimmickType {
   GIMMICK_FAIL       = 0,
-  GIMMICK_KEEP       = 1,
-  GIMMICK_SAVE       = 2,
-  GIMMICK_UPDATE_VAR = 3,
+  GIMMICK_SAVE       = 1,
+  GIMMICK_UPDATE_VAR = 2,
 #ifdef USE_CALLOUT
-  GIMMICK_CALLOUT    = 4,
+  GIMMICK_CALLOUT    = 3,
 #endif
 };