]> granicus.if.org Git - onig/commitdiff
refactoring
authorK.Kosako <kosako@sofnec.co.jp>
Wed, 14 Aug 2019 01:45:11 +0000 (10:45 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Wed, 14 Aug 2019 01:45:11 +0000 (10:45 +0900)
src/regint.h

index 5f5e6da3947f50535840b958130dee838650c7ec..e2a6a13267626de8156fe0349dee14f343a9ac02 100644 (file)
@@ -234,12 +234,12 @@ typedef unsigned int  uintptr_t;
 #ifdef USE_CALLOUT
 
 typedef struct {
-  int           flag;
-  OnigCalloutOf of;
-  int           in;
-  int           name_id;
-  const UChar*  tag_start;
-  const UChar*  tag_end;
+  int             flag;
+  OnigCalloutOf   of;
+  int             in;
+  int             name_id;
+  const UChar*    tag_start;
+  const UChar*    tag_end;
   OnigCalloutType type;
   OnigCalloutFunc start_func;
   OnigCalloutFunc end_func;
@@ -493,7 +493,6 @@ typedef struct _BBuf {
 enum OpCode {
   OP_FINISH = 0,        /* matching process terminator (no more alternative) */
   OP_END    = 1,        /* pattern code terminator (success end) */
-
   OP_EXACT1 = 2,        /* single byte, N = 1 */
   OP_EXACT2,            /* single byte, N = 2 */
   OP_EXACT3,            /* single byte, N = 3 */
@@ -506,24 +505,20 @@ enum OpCode {
   OP_EXACTMB2N,         /* mb-length = 2 */
   OP_EXACTMB3N,         /* mb-length = 3 */
   OP_EXACTMBN,          /* other length */
-
   OP_EXACT1_IC,         /* single byte, N = 1, ignore case */
   OP_EXACTN_IC,         /* single byte,        ignore case */
-
   OP_CCLASS,
   OP_CCLASS_MB,
   OP_CCLASS_MIX,
   OP_CCLASS_NOT,
   OP_CCLASS_MB_NOT,
   OP_CCLASS_MIX_NOT,
-
   OP_ANYCHAR,                 /* "."  */
   OP_ANYCHAR_ML,              /* "."  multi-line */
   OP_ANYCHAR_STAR,            /* ".*" */
   OP_ANYCHAR_ML_STAR,         /* ".*" multi-line */
   OP_ANYCHAR_STAR_PEEK_NEXT,
   OP_ANYCHAR_ML_STAR_PEEK_NEXT,
-
   OP_WORD,
   OP_WORD_ASCII,
   OP_NO_WORD,
@@ -532,16 +527,13 @@ enum OpCode {
   OP_NO_WORD_BOUNDARY,
   OP_WORD_BEGIN,
   OP_WORD_END,
-
   OP_TEXT_SEGMENT_BOUNDARY,
-
   OP_BEGIN_BUF,
   OP_END_BUF,
   OP_BEGIN_LINE,
   OP_END_LINE,
   OP_SEMI_END_BUF,
   OP_BEGIN_POSITION,
-
   OP_BACKREF1,
   OP_BACKREF2,
   OP_BACKREF_N,
@@ -552,34 +544,31 @@ enum OpCode {
   OP_BACKREF_WITH_LEVEL_IC,     /* \k<xxx+n>, \k<xxx-n> */
   OP_BACKREF_CHECK,             /* (?(n)), (?('name')) */
   OP_BACKREF_CHECK_WITH_LEVEL,  /* (?(n-level)), (?('name-level')) */
-
   OP_MEMORY_START,
   OP_MEMORY_START_PUSH,   /* push back-tracker to stack */
   OP_MEMORY_END_PUSH,     /* push back-tracker to stack */
   OP_MEMORY_END_PUSH_REC, /* push back-tracker to stack */
   OP_MEMORY_END,
   OP_MEMORY_END_REC,      /* push marker to stack */
-
   OP_FAIL,               /* pop stack and move */
   OP_JUMP,
   OP_PUSH,
   OP_PUSH_SUPER,
   OP_POP_OUT,
 #ifdef USE_OP_PUSH_OR_JUMP_EXACT
-  OP_PUSH_OR_JUMP_EXACT1,  /* if match exact then push, else jump. */
+  OP_PUSH_OR_JUMP_EXACT1,   /* if match exact then push, else jump. */
 #endif
-  OP_PUSH_IF_PEEK_NEXT,    /* if match exact then push, else none. */
-  OP_REPEAT,               /* {n,m} */
-  OP_REPEAT_NG,            /* {n,m}? (non greedy) */
+  OP_PUSH_IF_PEEK_NEXT,     /* if match exact then push, else none. */
+  OP_REPEAT,                /* {n,m} */
+  OP_REPEAT_NG,             /* {n,m}? (non greedy) */
   OP_REPEAT_INC,
-  OP_REPEAT_INC_NG,        /* non greedy */
-  OP_REPEAT_INC_SG,        /* search and get in stack */
-  OP_REPEAT_INC_NG_SG,     /* search and get in stack (non greedy) */
+  OP_REPEAT_INC_NG,         /* non greedy */
+  OP_REPEAT_INC_SG,         /* search and get in stack */
+  OP_REPEAT_INC_NG_SG,      /* search and get in stack (non greedy) */
   OP_EMPTY_CHECK_START,     /* null loop checker start */
   OP_EMPTY_CHECK_END,       /* null loop checker end   */
   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_PREC_READ_START,       /* (?=...)  start */
   OP_PREC_READ_END,         /* (?=...)  end   */
   OP_PREC_READ_NOT_START,   /* (?!...)  start */
@@ -589,7 +578,6 @@ enum OpCode {
   OP_LOOK_BEHIND,           /* (?<=...) start (no needs end opcode) */
   OP_LOOK_BEHIND_NOT_START, /* (?<!...) start */
   OP_LOOK_BEHIND_NOT_END,   /* (?<!...) end   */
-
   OP_CALL,                  /* \g<name> */
   OP_RETURN,
   OP_PUSH_SAVE_VAL,
@@ -601,8 +589,8 @@ enum OpCode {
 };
 
 enum SaveType {
-  SAVE_KEEP = 0, /* SAVE S */
-  SAVE_S = 1,
+  SAVE_KEEP        = 0, /* SAVE S */
+  SAVE_S           = 1,
   SAVE_RIGHT_RANGE = 2,
 };