return 0;
}
-static int
-add_opcode_option(regex_t* reg, int opcode, OnigOptionType option)
-{
- int r;
-
- r = add_opcode(reg, opcode);
- if (r != 0) return r;
- r = add_option(reg, option);
- return r;
-}
-
static int compile_length_tree(Node* node, regex_t* reg);
static int compile_tree(Node* node, regex_t* reg, ScanEnv* env);
tlen = compile_length_tree(NODE_ENCLOSURE_BODY(node), reg);
reg->options = prev;
- if (tlen < 0) return tlen;
-
- if (IS_DYNAMIC_OPTION(prev ^ node->option)) {
- return SIZE_OP_SET_OPTION_PUSH + SIZE_OP_SET_OPTION + SIZE_OP_FAIL
- + tlen + SIZE_OP_SET_OPTION;
- }
- else
- return tlen;
+ return tlen;
}
static int
int r;
OnigOptionType prev = reg->options;
- if (IS_DYNAMIC_OPTION(prev ^ node->o.options)) {
- r = add_opcode_option(reg, OP_SET_OPTION_PUSH, node->o.options);
- if (r != 0) return r;
- r = add_opcode_option(reg, OP_SET_OPTION, prev);
- if (r != 0) return r;
- r = add_opcode(reg, OP_FAIL);
- if (r != 0) return r;
- }
-
reg->options = node->o.options;
r = compile_tree(NODE_ENCLOSURE_BODY(node), reg, env);
reg->options = prev;
- if (IS_DYNAMIC_OPTION(prev ^ node->o.options)) {
- if (r != 0) return r;
- r = add_opcode_option(reg, OP_SET_OPTION, prev);
- }
return r;
}
((ctype) == ONIGENC_CTYPE_DIGIT && IS_DIGIT_ASCII(options)) ||\
((ctype) == ONIGENC_CTYPE_SPACE && IS_SPACE_ASCII(options))))
-/* OP_SET_OPTION is required for these options.
-#define IS_DYNAMIC_OPTION(option) \
- (((option) & (ONIG_OPTION_MULTILINE | ONIG_OPTION_IGNORECASE)) != 0)
-*/
-/* ignore-case and multibyte status are included in compiled code. */
-#define IS_DYNAMIC_OPTION(option) 0
-
#define DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag) \
((case_fold_flag) & ~INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR)