}
static int
-is_full_opt_exact_info(OptExact* ex)
+is_full_opt_exact(OptExact* ex)
{
return (ex->len >= OPT_EXACT_MAXLEN ? 1 : 0);
}
static void
-clear_opt_exact_info(OptExact* ex)
+clear_opt_exact(OptExact* ex)
{
clear_mml(&ex->mmd);
clear_opt_anc_info(&ex->anc);
}
static void
-copy_opt_exact_info(OptExact* to, OptExact* from)
+copy_opt_exact(OptExact* to, OptExact* from)
{
*to = *from;
}
static void
-concat_opt_exact_info(OptExact* to, OptExact* add, OnigEncoding enc)
+concat_opt_exact(OptExact* to, OptExact* add, OnigEncoding enc)
{
int i, j, len;
UChar *p, *end;
}
static void
-concat_opt_exact_info_str(OptExact* to, UChar* s, UChar* end,
+concat_opt_exact_str(OptExact* to, UChar* s, UChar* end,
int raw ARG_UNUSED, OnigEncoding enc)
{
int i, j, len;
}
static void
-alt_merge_opt_exact_info(OptExact* to, OptExact* add, OptEnv* env)
+alt_merge_opt_exact(OptExact* to, OptExact* add, OptEnv* env)
{
int i, j, len;
if (add->len == 0 || to->len == 0) {
- clear_opt_exact_info(to);
+ clear_opt_exact(to);
return ;
}
if (! is_equal_mml(&to->mmd, &add->mmd)) {
- clear_opt_exact_info(to);
+ clear_opt_exact(to);
return ;
}
}
static void
-select_opt_exact_info(OnigEncoding enc, OptExact* now, OptExact* alt)
+select_opt_exact(OnigEncoding enc, OptExact* now, OptExact* alt)
{
int v1, v2;
return ;
}
else if (v1 == 0) {
- copy_opt_exact_info(now, alt);
+ copy_opt_exact(now, alt);
return ;
}
else if (v1 <= 2 && v2 <= 2) {
if (alt->ignore_case == 0) v2 *= 2;
if (comp_distance_value(&now->mmd, &alt->mmd, v1, v2) > 0)
- copy_opt_exact_info(now, alt);
+ copy_opt_exact(now, alt);
}
static void
{
clear_mml(&opt->len);
clear_opt_anc_info(&opt->anc);
- clear_opt_exact_info(&opt->exb);
- clear_opt_exact_info(&opt->exm);
- clear_opt_exact_info(&opt->expr);
+ clear_opt_exact(&opt->exb);
+ clear_opt_exact(&opt->exm);
+ clear_opt_exact(&opt->expr);
clear_opt_map_info(&opt->map);
}
if (add->exb.len > 0) {
if (exb_reach) {
- concat_opt_exact_info(&to->exb, &add->exb, enc);
- clear_opt_exact_info(&add->exb);
+ concat_opt_exact(&to->exb, &add->exb, enc);
+ clear_opt_exact(&add->exb);
}
else if (exm_reach) {
- concat_opt_exact_info(&to->exm, &add->exb, enc);
- clear_opt_exact_info(&add->exb);
+ concat_opt_exact(&to->exm, &add->exb, enc);
+ clear_opt_exact(&add->exb);
}
}
- select_opt_exact_info(enc, &to->exm, &add->exb);
- select_opt_exact_info(enc, &to->exm, &add->exm);
+ select_opt_exact(enc, &to->exm, &add->exb);
+ select_opt_exact(enc, &to->exm, &add->exm);
if (to->expr.len > 0) {
if (add->len.max > 0) {
to->expr.len = add->len.max;
if (to->expr.mmd.max == 0)
- select_opt_exact_info(enc, &to->exb, &to->expr);
+ select_opt_exact(enc, &to->exb, &to->expr);
else
- select_opt_exact_info(enc, &to->exm, &to->expr);
+ select_opt_exact(enc, &to->exm, &to->expr);
}
}
else if (add->expr.len > 0) {
- copy_opt_exact_info(&to->expr, &add->expr);
+ copy_opt_exact(&to->expr, &add->expr);
}
select_opt_map_info(&to->map, &add->map);
alt_merge_node_opt_info(NodeOpt* to, NodeOpt* add, OptEnv* env)
{
alt_merge_opt_anc_info (&to->anc, &add->anc);
- alt_merge_opt_exact_info(&to->exb, &add->exb, env);
- alt_merge_opt_exact_info(&to->exm, &add->exm, env);
- alt_merge_opt_exact_info(&to->expr, &add->expr, env);
+ alt_merge_opt_exact(&to->exb, &add->exb, env);
+ alt_merge_opt_exact(&to->exm, &add->exm, env);
+ alt_merge_opt_exact(&to->expr, &add->expr, env);
alt_merge_opt_map_info(env->enc, &to->map, &add->map);
alt_merge_mml(&to->len, &add->len);
int is_raw = NODE_STRING_IS_RAW(node);
if (! NODE_STRING_IS_AMBIG(node)) {
- concat_opt_exact_info_str(&opt->exb, sn->s, sn->end,
+ concat_opt_exact_str(&opt->exb, sn->s, sn->end,
NODE_STRING_IS_RAW(node), env->enc);
if (slen > 0) {
add_char_opt_map_info(&opt->map, *(sn->s), env->enc);
max = ONIGENC_MBC_MAXLEN_DIST(env->enc) * n;
}
else {
- concat_opt_exact_info_str(&opt->exb, sn->s, sn->end,
+ concat_opt_exact_str(&opt->exb, sn->s, sn->end,
is_raw, env->enc);
opt->exb.ignore_case = 1;
r = optimize_node_left(NODE_BODY(node), &nopt, env);
if (r == 0) {
if (nopt.exb.len > 0)
- copy_opt_exact_info(&opt->expr, &nopt.exb);
+ copy_opt_exact(&opt->expr, &nopt.exb);
else if (nopt.exm.len > 0)
- copy_opt_exact_info(&opt->expr, &nopt.exm);
+ copy_opt_exact(&opt->expr, &nopt.exm);
opt->expr.reach_end = 0;
if (nopt.exb.len > 0) {
if (nopt.exb.reach_end) {
for (i = 2; i <= qn->lower &&
- ! is_full_opt_exact_info(&opt->exb); i++) {
- concat_opt_exact_info(&opt->exb, &nopt.exb, env->enc);
+ ! is_full_opt_exact(&opt->exb); i++) {
+ concat_opt_exact(&opt->exb, &nopt.exb, env->enc);
}
if (i < qn->lower) {
opt->exb.reach_end = 0;
}
static int
-set_optimize_exact_info(regex_t* reg, OptExact* e)
+set_optimize_exact(regex_t* reg, OptExact* e)
{
int r;
}
if (opt.exb.len > 0 || opt.exm.len > 0) {
- select_opt_exact_info(reg->enc, &opt.exb, &opt.exm);
+ select_opt_exact(reg->enc, &opt.exb, &opt.exm);
if (opt.map.value > 0 &&
comp_opt_exact_or_map_info(&opt.exb, &opt.map) > 0) {
goto set_map;
}
else {
- r = set_optimize_exact_info(reg, &opt.exb);
+ r = set_optimize_exact(reg, &opt.exb);
set_sub_anchor(reg, &opt.exb.anc);
}
}