typedef struct {
MinMaxLen mmd; /* info position */
OptAnc anc;
-
int reach_end;
int ignore_case;
int len;
typedef struct {
MinMaxLen mmd; /* info position */
OptAnc anc;
-
int value; /* weighted value */
UChar map[ONIG_CHAR_TABLE_SIZE];
} OptMap;
typedef struct {
- MinMaxLen len;
-
+ MinMaxLen len;
OptAnc anc;
OptExact exb; /* boundary */
OptExact exm; /* middle */
OptExact expr; /* prec read (?=...) */
-
OptMap map; /* boundary */
-} NodeOptInfo;
+} NodeOpt;
static int
}
static void
-set_bound_node_opt_info(NodeOptInfo* opt, MinMaxLen* mmd)
+set_bound_node_opt_info(NodeOpt* opt, MinMaxLen* mmd)
{
copy_mml(&(opt->exb.mmd), mmd);
copy_mml(&(opt->expr.mmd), mmd);
}
static void
-clear_node_opt_info(NodeOptInfo* opt)
+clear_node_opt_info(NodeOpt* opt)
{
clear_mml(&opt->len);
clear_opt_anc_info(&opt->anc);
}
static void
-copy_node_opt_info(NodeOptInfo* to, NodeOptInfo* from)
+copy_node_opt_info(NodeOpt* to, NodeOpt* from)
{
*to = *from;
}
static void
-concat_left_node_opt_info(OnigEncoding enc, NodeOptInfo* to, NodeOptInfo* add)
+concat_left_node_opt_info(OnigEncoding enc, NodeOpt* to, NodeOpt* add)
{
int exb_reach, exm_reach;
OptAnc tanc;
}
static void
-alt_merge_node_opt_info(NodeOptInfo* to, NodeOptInfo* add, OptEnv* env)
+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);
#define MAX_NODE_OPT_INFO_REF_COUNT 5
static int
-optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
+optimize_node_left(Node* node, NodeOpt* opt, OptEnv* env)
{
int r = 0;
case NODE_LIST:
{
OptEnv nenv;
- NodeOptInfo nopt;
+ NodeOpt nopt;
Node* nd = node;
copy_opt_env(&nenv, env);
case NODE_ALT:
{
- NodeOptInfo nopt;
+ NodeOpt nopt;
Node* nd = node;
do {
case ANCHOR_PREC_READ:
{
- NodeOptInfo nopt;
+ NodeOpt nopt;
r = optimize_node_left(NODE_BODY(node), &nopt, env);
if (r == 0) {
{
int i;
OnigLen min, max;
- NodeOptInfo nopt;
+ NodeOpt nopt;
QuantNode* qn = QUANT_(node);
r = optimize_node_left(NODE_BODY(node), &nopt, env);
case ENCLOSURE_IF_ELSE:
{
OptEnv nenv;
- NodeOptInfo nopt;
+ NodeOpt nopt;
copy_opt_env(&nenv, env);
r = optimize_node_left(NODE_ENCLOSURE_BODY(en), &nopt, &nenv);
{
int r;
- NodeOptInfo opt;
+ NodeOpt opt;
OptEnv env;
env.enc = reg->enc;