r = SIZE_OPCODE;
break;
- case NODE_BREF:
+ case NODE_BACKREF:
{
- BRefNode* br = BREF_(node);
+ BackRefNode* br = BACKREF_(node);
#ifdef USE_BACKREF_WITH_LEVEL
if (NODE_IS_NEST_LEVEL(node)) {
}
break;
- case NODE_BREF:
+ case NODE_BACKREF:
{
- BRefNode* br = BREF_(node);
+ BackRefNode* br = BACKREF_(node);
#ifdef USE_BACKREF_WITH_LEVEL
if (NODE_IS_NEST_LEVEL(node)) {
{
int i, pos, n, old_num;
int *backs;
- BRefNode* bn = BREF_(node);
+ BackRefNode* bn = BACKREF_(node);
if (! NODE_IS_BY_NAME(node))
return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;
r = renumber_by_map(NODE_BODY(node), map);
break;
- case NODE_BREF:
+ case NODE_BACKREF:
r = renumber_node_backref(node, map);
break;
r = numbered_ref_check(NODE_BODY(node));
break;
- case NODE_BREF:
+ case NODE_BACKREF:
if (! NODE_IS_BY_NAME(node))
return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;
break;
Node* n = NULL_NODE;
switch (NODE_TYPE(node)) {
- case NODE_BREF:
+ case NODE_BACKREF:
case NODE_ALT:
#ifdef USE_SUBEXP_CALL
case NODE_CALL:
len = 0;
switch (NODE_TYPE(node)) {
- case NODE_BREF:
+ case NODE_BACKREF:
{
int i;
int* backs;
MemEnv* mem_env = SCANENV_MEMENV(env);
- BRefNode* br = BREF_(node);
+ BackRefNode* br = BACKREF_(node);
if (NODE_IS_RECURSION(node)) break;
backs = BACKREFS_P(br);
len = ONIGENC_MBC_MAXLEN_DIST(env->enc);
break;
- case NODE_BREF:
+ case NODE_BACKREF:
{
int i;
int* backs;
MemEnv* mem_env = SCANENV_MEMENV(env);
- BRefNode* br = BREF_(node);
+ BackRefNode* br = BACKREF_(node);
if (NODE_IS_RECURSION(node)) {
len = ONIG_INFINITE_DISTANCE;
break;
r = check_backrefs(NODE_BODY(node), env);
break;
- case NODE_BREF:
+ case NODE_BACKREF:
{
int i;
- BRefNode* br = BREF_(node);
+ BackRefNode* br = BACKREF_(node);
int* backs = BACKREFS_P(br);
MemEnv* mem_env = SCANENV_MEMENV(env);
}
break;
- case NODE_BREF:
+ case NODE_BACKREF:
case NODE_STR:
case NODE_CTYPE:
case NODE_CCLASS:
}
break;
- case NODE_BREF:
+ case NODE_BACKREF:
case NODE_STR:
case NODE_CTYPE:
case NODE_CCLASS:
}
break;
- case NODE_BREF:
+ case NODE_BACKREF:
{
int i;
int* p;
- BRefNode* br = BREF_(node);
+ BackRefNode* br = BACKREF_(node);
p = BACKREFS_P(br);
for (i = 0; i < br->back_num; i++) {
if (p[i] > env->num_mem) return ONIGERR_INVALID_BACKREF;
}
break;
- case NODE_BREF:
+ case NODE_BACKREF:
{
int i;
int* backs;
OnigLen min, max, tmin, tmax;
MemEnv* mem_env = SCANENV_MEMENV(env->scan_env);
- BRefNode* br = BREF_(node);
+ BackRefNode* br = BACKREF_(node);
if (NODE_IS_RECURSION(node)) {
set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE);
}
break;
- case NODE_BREF:
+ case NODE_BACKREF:
{
int* p;
- BRefNode* br = BREF_(node);
+ BackRefNode* br = BACKREF_(node);
p = BACKREFS_P(br);
fprintf(f, "<backref:%p>", node);
for (i = 0; i < br->back_num; i++) {
}
break;
- case NODE_BREF:
- if (IS_NOT_NULL(BREF_(node)->back_dynamic))
- xfree(BREF_(node)->back_dynamic);
+ case NODE_BACKREF:
+ if (IS_NOT_NULL(BACKREF_(node)->back_dynamic))
+ xfree(BACKREF_(node)->back_dynamic);
break;
case NODE_QUANT:
CHECK_NULL_RETURN(node);
- SET_NODE_TYPE(node, NODE_BREF);
- BREF_(node)->back_num = back_num;
- BREF_(node)->back_dynamic = (int* )NULL;
+ SET_NODE_TYPE(node, NODE_BACKREF);
+ BACKREF_(node)->back_num = back_num;
+ BACKREF_(node)->back_dynamic = (int* )NULL;
if (by_name != 0)
NODE_STATUS_ADD(node, NST_BY_NAME);
#ifdef USE_BACKREF_WITH_LEVEL
if (exist_level != 0) {
NODE_STATUS_ADD(node, NST_NEST_LEVEL);
- BREF_(node)->nest_level = nest_level;
+ BACKREF_(node)->nest_level = nest_level;
}
#endif
if (back_num <= NODE_BACKREFS_SIZE) {
for (i = 0; i < back_num; i++)
- BREF_(node)->back_static[i] = backrefs[i];
+ BACKREF_(node)->back_static[i] = backrefs[i];
}
else {
int* p = (int* )xmalloc(sizeof(int) * back_num);
onig_node_free(node);
return NULL;
}
- BREF_(node)->back_dynamic = p;
+ BACKREF_(node)->back_dynamic = p;
for (i = 0; i < back_num; i++)
p[i] = backrefs[i];
}
NODE_STR = 0,
NODE_CCLASS = 1,
NODE_CTYPE = 2,
- NODE_BREF = 3,
+ NODE_BACKREF = 3,
NODE_QUANT = 4,
NODE_ENCLOSURE = 5,
NODE_ANCHOR = 6,
#define BIT_NODE_STR NODE_TYPE2BIT(NODE_STR)
#define BIT_NODE_CCLASS NODE_TYPE2BIT(NODE_CCLASS)
#define BIT_NODE_CTYPE NODE_TYPE2BIT(NODE_CTYPE)
-#define BIT_NODE_BREF NODE_TYPE2BIT(NODE_BREF)
+#define BIT_NODE_BACKREF NODE_TYPE2BIT(NODE_BACKREF)
#define BIT_NODE_QUANT NODE_TYPE2BIT(NODE_QUANT)
#define BIT_NODE_ENCLOSURE NODE_TYPE2BIT(NODE_ENCLOSURE)
#define BIT_NODE_ANCHOR NODE_TYPE2BIT(NODE_ANCHOR)
#define NODE_IS_SIMPLE_TYPE(node) \
((NODE_TYPE2BIT(NODE_TYPE(node)) & \
- (BIT_NODE_STR | BIT_NODE_CCLASS | BIT_NODE_CTYPE | BIT_NODE_BREF)) != 0)
+ (BIT_NODE_STR | BIT_NODE_CCLASS | BIT_NODE_CTYPE | BIT_NODE_BACKREF)) != 0)
#define NODE_TYPE(node) ((node)->u.base.node_type)
#define SET_NODE_TYPE(node, ntype) (node)->u.base.node_type = (ntype)
#define STR_(node) (&((node)->u.str))
#define CCLASS_(node) (&((node)->u.cclass))
#define CTYPE_(node) (&((node)->u.ctype))
-#define BREF_(node) (&((node)->u.bref))
+#define BACKREF_(node) (&((node)->u.backref))
#define QUANT_(node) (&((node)->u.quant))
#define ENCLOSURE_(node) (&((node)->u.enclosure))
#define ANCHOR_(node) (&((node)->u.anchor))
int back_static[NODE_BACKREFS_SIZE];
int* back_dynamic;
int nest_level;
-} BRefNode;
+} BackRefNode;
typedef struct {
NodeType node_type;
CClassNode cclass;
QuantNode quant;
EnclosureNode enclosure;
- BRefNode bref;
+ BackRefNode backref;
AnchorNode anchor;
ConsAltNode cons;
CtypeNode ctype;