diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-09-01 19:54:36 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-09-01 19:54:36 +0200 |
commit | a3ec3a8d99a951fc599818b1ea9a2aa218b10fa5 (patch) | |
tree | 3ee714ca52a54635d91c7e3c10b968e0048022be /src/regparse.h | |
parent | 6b31069db6198cd50cc17f2c63917dd2df5775fb (diff) | |
parent | de5adb21f7224352652be174c66fb88e596bb49c (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/regparse.h')
-rw-r--r-- | src/regparse.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/regparse.h b/src/regparse.h index b7260ea..57219a4 100644 --- a/src/regparse.h +++ b/src/regparse.h @@ -100,10 +100,12 @@ enum GimmickType { #define ANCHOR_ANYCHAR_STAR_MASK (ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML) #define ANCHOR_END_BUF_MASK (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF) -#define ENCLOSURE_MEMORY (1<<0) -#define ENCLOSURE_OPTION (1<<1) -#define ENCLOSURE_STOP_BACKTRACK (1<<2) -#define ENCLOSURE_IF_ELSE (1<<3) +enum EnclosureType { + ENCLOSURE_MEMORY = 0, + ENCLOSURE_OPTION = 1, + ENCLOSURE_STOP_BACKTRACK = 2, + ENCLOSURE_IF_ELSE = 3, +}; #define NODE_STRING_MARGIN 16 #define NODE_STRING_BUF_SIZE 24 /* sizeof(CClassNode) - sizeof(int)*4 */ @@ -125,7 +127,7 @@ enum GimmickType { (((node)->u.str.flag & STRING_DONT_GET_OPT_INFO) != 0) #define BACKREFS_P(br) \ - (IS_NOT_NULL((br)->back_dynamic) ? (br)->back_dynamic : (br)->back_static); + (IS_NOT_NULL((br)->back_dynamic) ? (br)->back_dynamic : (br)->back_static) #define QUANT_BODY_IS_NOT_EMPTY 0 #define QUANT_BODY_IS_EMPTY 1 @@ -233,7 +235,7 @@ typedef struct { int status; struct _Node* body; - int type; + enum EnclosureType type; union { struct { int regnum; @@ -301,6 +303,7 @@ typedef struct { int type; int char_len; + int ascii_mode; } AnchorNode; typedef struct { @@ -318,6 +321,7 @@ typedef struct { int ctype; int not; OnigOptionType options; + int ascii_mode; } CtypeNode; typedef struct { @@ -392,9 +396,7 @@ typedef struct { int has_call_zero; #endif int num_mem; -#ifdef USE_NAMED_GROUP int num_named; -#endif int mem_alloc; MemEnv mem_env_static[SCANENV_MEMENV_SIZE]; MemEnv* mem_env_dynamic; @@ -417,13 +419,11 @@ typedef struct { #define IS_SYNTAX_OP2(syn, opm) (((syn)->op2 & (opm)) != 0) #define IS_SYNTAX_BV(syn, bvm) (((syn)->behavior & (bvm)) != 0) -#ifdef USE_NAMED_GROUP typedef struct { int new_val; } GroupNumRemap; extern int onig_renumber_name_table P_((regex_t* reg, GroupNumRemap* map)); -#endif extern int onig_strncmp P_((const UChar* s1, const UChar* s2, int n)); extern void onig_strcpy P_((UChar* dest, const UChar* src, const UChar* end)); @@ -435,7 +435,7 @@ extern int onig_node_str_cat P_((Node* node, const UChar* s, const UChar* end extern int onig_node_str_set P_((Node* node, const UChar* s, const UChar* end)); extern void onig_node_free P_((Node* node)); extern Node* onig_node_new_enclosure P_((int type)); -extern Node* onig_node_new_anchor P_((int type)); +extern Node* onig_node_new_anchor P_((int type, int ascii_mode)); extern Node* onig_node_new_str P_((const UChar* s, const UChar* end)); extern Node* onig_node_new_list P_((Node* left, Node* right)); extern Node* onig_node_list_add P_((Node* list, Node* x)); @@ -448,9 +448,7 @@ extern int onig_is_code_in_cc P_((OnigEncoding enc, OnigCodePoint code, CClas extern OnigLen onig_get_tiny_min_len(Node* node, unsigned int inhibit_node_types, int* invalid_node); #ifdef ONIG_DEBUG -#ifdef USE_NAMED_GROUP extern int onig_print_names(FILE*, regex_t*); #endif -#endif #endif /* REGPARSE_H */ |