r = add_opcode(reg, OP_CALL);
if (r) return r;
node->call_addr = BBUF_GET_OFFSET_POS(reg) + SIZE_ABSADDR + SIZE_OP_JUMP;
- NODE_STATUS_SET(node, NST_ADDR_FIXED);
+ NODE_STATUS_ADD(node, NST_ADDR_FIXED);
r = add_abs_addr(reg, (int )node->call_addr);
if (r) return r;
len = compile_length_tree(NODE_ENCLOSE_BODY(node), reg);
r = get_char_length_tree1(NODE_BODY(node), reg, len, level);
if (r == 0) {
en->char_len = *len;
- NODE_STATUS_SET(node, NST_CLEN_FIXED);
+ NODE_STATUS_ADD(node, NST_CLEN_FIXED);
}
}
break;
if (NODE_IS_MARK1(node))
*min = 0; // recursive
else {
- NODE_STATUS_SET(node, NST_MARK1);
+ NODE_STATUS_ADD(node, NST_MARK1);
r = get_min_len(NODE_BODY(node), min, env);
NODE_STATUS_CLEAR(node, NST_MARK1);
if (r == 0) {
en->min_len = *min;
- NODE_STATUS_SET(node, NST_MIN_FIXED);
+ NODE_STATUS_ADD(node, NST_MIN_FIXED);
}
}
}
if (NODE_IS_MARK1(node))
*max = ONIG_INFINITE_DISTANCE;
else {
- NODE_STATUS_SET(node, NST_MARK1);
+ NODE_STATUS_ADD(node, NST_MARK1);
r = get_max_len(NODE_BODY(node), max, env);
NODE_STATUS_CLEAR(node, NST_MARK1);
if (r == 0) {
en->max_len = *max;
- NODE_STATUS_SET(node, NST_MAX_FIXED);
+ NODE_STATUS_ADD(node, NST_MAX_FIXED);
}
}
}
else if (NODE_IS_MARK1(node))
return (head == 0 ? RECURSION_EXIST : RECURSION_INFINITE);
else {
- NODE_STATUS_SET(node, NST_MARK2);
+ NODE_STATUS_ADD(node, NST_MARK2);
r = subexp_inf_recursive_check(NODE_BODY(node), env, head);
NODE_STATUS_CLEAR(node, NST_MARK2);
}
case NT_ENCLOSE:
if (NODE_IS_RECURSION(node)) {
- NODE_STATUS_SET(node, NST_MARK1);
+ NODE_STATUS_ADD(node, NST_MARK1);
r = subexp_inf_recursive_check(NODE_BODY(node), env, 1);
if (r > 0) return ONIGERR_NEVER_ENDING_RECURSION;
NODE_STATUS_CLEAR(node, NST_MARK1);
case NT_CALL:
r = subexp_recursive_check(NODE_BODY(node));
- if (r != 0) NODE_STATUS_SET(node, NST_RECURSION);
+ if (r != 0) NODE_STATUS_ADD(node, NST_RECURSION);
break;
case NT_ENCLOSE:
else if (NODE_IS_MARK1(node))
return 1; /* recursion */
else {
- NODE_STATUS_SET(node, NST_MARK2);
+ NODE_STATUS_ADD(node, NST_MARK2);
r = subexp_recursive_check(NODE_BODY(node));
NODE_STATUS_CLEAR(node, NST_MARK2);
}
case NT_ENCLOSE:
if (! NODE_IS_RECURSION(node)) {
if (NODE_IS_CALLED(node)) {
- NODE_STATUS_SET(node, NST_MARK1);
+ NODE_STATUS_ADD(node, NST_MARK1);
r = subexp_recursive_check(NODE_BODY(node));
if (r != 0)
- NODE_STATUS_SET(node, NST_RECURSION);
+ NODE_STATUS_ADD(node, NST_RECURSION);
NODE_STATUS_CLEAR(node, NST_MARK1);
}
}
ONIGERR_UNDEFINED_NAME_REFERENCE, cn->name, cn->name_end);
return ONIGERR_UNDEFINED_NAME_REFERENCE;
}
- NODE_STATUS_SET(NODE_CALL_BODY(cn), NST_CALLED);
+ NODE_STATUS_ADD(NODE_CALL_BODY(cn), NST_CALLED);
BIT_STATUS_ON_AT(env->bt_mem_start, cn->group_num);
cn->unset_addr_list = env->unset_addr_list;
}
if (IS_NOT_NULL(y) && is_not_included(x, y, reg)) {
Node* en = onig_node_new_enclose(ENCLOSE_STOP_BACKTRACK);
CHECK_NULL_RETURN_MEMERR(en);
- NODE_STATUS_SET(en, NST_STOP_BT_SIMPLE_REPEAT);
+ NODE_STATUS_ADD(en, NST_STOP_BT_SIMPLE_REPEAT);
swap_node(node, en);
NODE_BODY(node) = en;
}
BIT_STATUS_ON_AT(env->bt_mem_end, p[i]);
}
#endif
- NODE_STATUS_SET(mem_env[p[i]].node, NST_MEM_BACKREFED);
+ NODE_STATUS_ADD(mem_env[p[i]].node, NST_MEM_BACKREFED);
}
}
break;
Node* target = NODE_BODY(node);
if ((state & IN_REPEAT) != 0) {
- NODE_STATUS_SET(node, NST_IN_REPEAT);
+ NODE_STATUS_ADD(node, NST_IN_REPEAT);
}
if (IS_REPEAT_INFINITE(qn->upper) || qn->upper >= 1) {
case ENCLOSE_MEMORY:
if ((state & (IN_ALT | IN_NOT | IN_VAR_REPEAT | IN_CALL)) != 0) {
BIT_STATUS_ON_AT(env->bt_mem_start, en->regnum);
- /* NODE_STATUS_SET(node, NST_MEM_IN_ALT_NOT); */
+ /* NODE_STATUS_ADD(node, NST_MEM_IN_ALT_NOT); */
}
if (NODE_IS_CALLED(node))
state |= IN_CALL;
if (NODE_IS_RECURSION(node))
state |= IN_RECCALL;
else if ((state & IN_RECCALL) != 0)
- NODE_STATUS_SET(node, NST_RECURSION);
+ NODE_STATUS_ADD(node, NST_RECURSION);
#endif
r = setup_tree(NODE_BODY(node), reg, state, env);
break;
tqn->greedy != 0) { /* (?>a*), a*+ etc... */
int qtype = NODE_TYPE(NODE_BODY(target));
if (IS_NODE_TYPE_SIMPLE(qtype))
- NODE_STATUS_SET(node, NST_STOP_BT_SIMPLE_REPEAT);
+ NODE_STATUS_ADD(node, NST_STOP_BT_SIMPLE_REPEAT);
}
}
}
NBREF(node)->back_num = back_num;
NBREF(node)->back_dynamic = (int* )NULL;
if (by_name != 0)
- NODE_STATUS_SET(node, NST_NAME_REF);
+ NODE_STATUS_ADD(node, NST_NAME_REF);
#ifdef USE_BACKREF_WITH_LEVEL
if (exist_level != 0) {
- NODE_STATUS_SET(node, NST_NEST_LEVEL);
+ NODE_STATUS_ADD(node, NST_NEST_LEVEL);
NBREF(node)->nest_level = nest_level;
}
#endif
for (i = 0; i < back_num; i++) {
if (backrefs[i] <= env->num_mem &&
IS_NULL(SCANENV_MEMENV(env)[backrefs[i]].node)) {
- NODE_STATUS_SET(node, NST_RECURSION); /* /...(\1).../ */
+ NODE_STATUS_ADD(node, NST_RECURSION); /* /...(\1).../ */
break;
}
}
NQTFR(node)->next_head_exact = NULL_NODE;
NQTFR(node)->is_refered = 0;
if (by_number != 0)
- NODE_STATUS_SET(node, NST_BY_NUMBER);
+ NODE_STATUS_ADD(node, NST_BY_NUMBER);
#ifdef USE_COMBINATION_EXPLOSION_CHECK
NQTFR(node)->comb_exp_check_num = 0;
Node* node = node_new_enclose(ENCLOSE_MEMORY);
CHECK_NULL_RETURN(node);
if (is_named != 0)
- NODE_STATUS_SET(node, NST_NAMED_GROUP);
+ NODE_STATUS_ADD(node, NST_NAMED_GROUP);
#ifdef USE_SUBEXP_CALL
NENCLOSE(node)->option = option;