]> granicus.if.org Git - onig/commitdiff
refactoring
authorK.Kosako <kosako@sofnec.co.jp>
Tue, 1 Aug 2017 04:41:53 +0000 (13:41 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Tue, 1 Aug 2017 04:41:53 +0000 (13:41 +0900)
src/regcomp.c
src/regexec.c
src/regint.h

index 906f629cf44a8eb06dae9c02d5c00f204d3ebf46..76143cefa2ef5424656ae7ae7e1c1d42c480c68f 100644 (file)
@@ -1576,7 +1576,7 @@ compile_length_anchor_node(AnchorNode* node, regex_t* reg)
 
   switch (node->type) {
   case ANCHOR_PREC_READ:
-    len = SIZE_OP_PUSH_POS + tlen + SIZE_OP_POP_POS;
+    len = SIZE_OP_PREC_READ_START + tlen + SIZE_OP_PREC_READ_END;
     break;
   case ANCHOR_PREC_READ_NOT:
     len = SIZE_OP_PUSH_PREC_READ_NOT + tlen + SIZE_OP_FAIL_PREC_READ_NOT;
@@ -1617,11 +1617,11 @@ compile_anchor_node(AnchorNode* node, regex_t* reg, ScanEnv* env)
 #endif
 
   case ANCHOR_PREC_READ:
-    r = add_opcode(reg, OP_PUSH_POS);
+    r = add_opcode(reg, OP_PREC_READ_START);
     if (r != 0) return r;
     r = compile_tree(NODE_ANCHOR_BODY(node), reg, env);
     if (r != 0) return r;
-    r = add_opcode(reg, OP_POP_POS);
+    r = add_opcode(reg, OP_PREC_READ_END);
     break;
 
   case ANCHOR_PREC_READ_NOT:
@@ -6811,8 +6811,8 @@ OnigOpInfoType OnigOpInfo[] = {
   { OP_EMPTY_CHECK_END,     "empty-check-end",      ARG_MEMNUM  },
   { OP_EMPTY_CHECK_END_MEMST,"empty-check-end-memst", ARG_MEMNUM  },
   { OP_EMPTY_CHECK_END_MEMST_PUSH,"empty-check-end-memst-push", ARG_MEMNUM  },
-  { OP_PUSH_POS,             "push-pos",             ARG_NON },
-  { OP_POP_POS,              "pop-pos",              ARG_NON },
+  { OP_PREC_READ_START,      "push-pos",             ARG_NON },
+  { OP_PREC_READ_END,        "pop-pos",              ARG_NON },
   { OP_PUSH_PREC_READ_NOT,   "push-prec-read-not",   ARG_RELADDR },
   { OP_FAIL_PREC_READ_NOT,   "fail-prec-read-not",   ARG_NON },
   { OP_PUSH_STOP_BT,         "push-stop-bt",         ARG_NON },
index 322de3e6a6270f4fe71cb04d709979e449591796..006c3de7ae675740333adaefe608689b8ef82d18 100644 (file)
@@ -2873,13 +2873,13 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
       goto repeat_inc_ng;
       break;
 
-    case OP_PUSH_POS:  MOP_IN(OP_PUSH_POS);
+    case OP_PREC_READ_START:  MOP_IN(OP_PREC_READ_START);
       STACK_PUSH_POS(s, sprev);
       MOP_OUT;
       continue;
       break;
 
-    case OP_POP_POS:  MOP_IN(OP_POP_POS);
+    case OP_PREC_READ_END:  MOP_IN(OP_PREC_READ_END);
       {
         STACK_POS_END(stkp);
         s     = stkp->u.state.pstr;
index a96d7ec0a18419bf76018f6281f13e1315220da4..807bbe2191a5b5bf31cda4bde1e28ea80ab258bb 100644 (file)
@@ -531,8 +531,8 @@ enum OpCode {
   OP_EMPTY_CHECK_END_MEMST, /* null loop checker end (with capture status) */
   OP_EMPTY_CHECK_END_MEMST_PUSH, /* with capture status and push check-end */
 
-  OP_PUSH_POS,             /* (?=...)  start */
-  OP_POP_POS,              /* (?=...)  end   */
+  OP_PREC_READ_START,             /* (?=...)  start */
+  OP_PREC_READ_END,              /* (?=...)  end   */
   OP_PUSH_PREC_READ_NOT,   /* (?!...)  start */
   OP_FAIL_PREC_READ_NOT,   /* (?!...)  end   */
   OP_PUSH_STOP_BT,         /* (?>...)  start */
@@ -625,9 +625,9 @@ typedef int UpdateVarType;
 #define SIZE_OP_PUSH_IF_PEEK_NEXT      (SIZE_OPCODE + SIZE_RELADDR + 1)
 #define SIZE_OP_REPEAT_INC             (SIZE_OPCODE + SIZE_MEMNUM)
 #define SIZE_OP_REPEAT_INC_NG          (SIZE_OPCODE + SIZE_MEMNUM)
-#define SIZE_OP_PUSH_POS                SIZE_OPCODE
+#define SIZE_OP_PREC_READ_START         SIZE_OPCODE
 #define SIZE_OP_PUSH_PREC_READ_NOT     (SIZE_OPCODE + SIZE_RELADDR)
-#define SIZE_OP_POP_POS                 SIZE_OPCODE
+#define SIZE_OP_PREC_READ_END           SIZE_OPCODE
 #define SIZE_OP_FAIL_PREC_READ_NOT      SIZE_OPCODE
 #define SIZE_OP_SET_OPTION             (SIZE_OPCODE + SIZE_OPTION)
 #define SIZE_OP_SET_OPTION_PUSH        (SIZE_OPCODE + SIZE_OPTION)