mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Only define history_root member of the Oniguruma re_registers struct if USE_CAPTURE_HISTORY is enabled
This commit is contained in:
parent
14dd8d6b37
commit
31cf13060c
2 changed files with 8 additions and 0 deletions
|
@ -701,6 +701,7 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
|
|||
#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \
|
||||
((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])
|
||||
|
||||
#ifdef USE_CAPTURE_HISTORY
|
||||
typedef struct OnigCaptureTreeNodeStruct {
|
||||
int group; /* group number */
|
||||
OnigPosition beg;
|
||||
|
@ -709,6 +710,7 @@ typedef struct OnigCaptureTreeNodeStruct {
|
|||
int num_childs;
|
||||
struct OnigCaptureTreeNodeStruct** childs;
|
||||
} OnigCaptureTreeNode;
|
||||
#endif
|
||||
|
||||
/* match result region type */
|
||||
struct re_registers {
|
||||
|
@ -716,8 +718,10 @@ struct re_registers {
|
|||
int num_regs;
|
||||
OnigPosition* beg;
|
||||
OnigPosition* end;
|
||||
#ifdef USE_CAPTURE_HISTORY
|
||||
/* extended */
|
||||
OnigCaptureTreeNode* history_root; /* capture history tree root */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* capture tree traverse */
|
||||
|
@ -866,8 +870,10 @@ ONIG_EXTERN
|
|||
int onig_number_of_captures(const OnigRegexType *reg);
|
||||
ONIG_EXTERN
|
||||
int onig_number_of_capture_histories(const OnigRegexType *reg);
|
||||
#ifdef USE_CAPTURE_HISTORY
|
||||
ONIG_EXTERN
|
||||
OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region);
|
||||
#endif
|
||||
ONIG_EXTERN
|
||||
int onig_capture_tree_traverse(OnigRegion* region, int at, int(*callback_func)(int,OnigPosition,OnigPosition,int,int,void*), void* arg);
|
||||
ONIG_EXTERN
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue