Commit e3abf333 authored by Mitchell Blank Jr's avatar Mitchell Blank Jr

C++ compilability: "not" is a C++ keyword, avoid it

see http://en.cppreference.com/w/cpp/language/operator_alternative
parent 365cc40a
...@@ -1640,8 +1640,8 @@ compile_tree(Node* node, regex_t* reg) ...@@ -1640,8 +1640,8 @@ compile_tree(Node* node, regex_t* reg)
switch (NCTYPE(node)->ctype) { switch (NCTYPE(node)->ctype) {
case ONIGENC_CTYPE_WORD: case ONIGENC_CTYPE_WORD:
if (NCTYPE(node)->not != 0) op = OP_NOT_WORD; if (NCTYPE(node)->is_not != 0) op = OP_NOT_WORD;
else op = OP_WORD; else op = OP_WORD;
break; break;
default: default:
return ONIGERR_TYPE_BUG; return ONIGERR_TYPE_BUG;
...@@ -2440,8 +2440,8 @@ is_not_included(Node* x, Node* y, regex_t* reg) ...@@ -2440,8 +2440,8 @@ is_not_included(Node* x, Node* y, regex_t* reg)
{ {
switch (ytype) { switch (ytype) {
case NT_CTYPE: case NT_CTYPE:
if (NCTYPE(y)->ctype == NCTYPE(x)->ctype && if (NCTYPE(y)->ctype == NCTYPE(x)->ctype &&
NCTYPE(y)->not != NCTYPE(x)->not) NCTYPE(y)->is_not != NCTYPE(x)->is_not)
return 1; return 1;
else else
return 0; return 0;
...@@ -2473,7 +2473,7 @@ is_not_included(Node* x, Node* y, regex_t* reg) ...@@ -2473,7 +2473,7 @@ is_not_included(Node* x, Node* y, regex_t* reg)
case NT_CTYPE: case NT_CTYPE:
switch (NCTYPE(y)->ctype) { switch (NCTYPE(y)->ctype) {
case ONIGENC_CTYPE_WORD: case ONIGENC_CTYPE_WORD:
if (NCTYPE(y)->not == 0) { if (NCTYPE(y)->is_not == 0) {
if (IS_NULL(xc->mbuf) && !IS_NCCLASS_NOT(xc)) { if (IS_NULL(xc->mbuf) && !IS_NCCLASS_NOT(xc)) {
for (i = 0; i < SINGLE_BYTE_SIZE; i++) { for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
if (BITSET_AT(xc->bs, i)) { if (BITSET_AT(xc->bs, i)) {
...@@ -2550,9 +2550,9 @@ is_not_included(Node* x, Node* y, regex_t* reg) ...@@ -2550,9 +2550,9 @@ is_not_included(Node* x, Node* y, regex_t* reg)
switch (NCTYPE(y)->ctype) { switch (NCTYPE(y)->ctype) {
case ONIGENC_CTYPE_WORD: case ONIGENC_CTYPE_WORD:
if (ONIGENC_IS_MBC_WORD(reg->enc, xs->s, xs->end)) if (ONIGENC_IS_MBC_WORD(reg->enc, xs->s, xs->end))
return NCTYPE(y)->not; return NCTYPE(y)->is_not;
else else
return !(NCTYPE(y)->not); return !(NCTYPE(y)->is_not);
break; break;
default: default:
break; break;
...@@ -4668,7 +4668,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env) ...@@ -4668,7 +4668,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
switch (NCTYPE(node)->ctype) { switch (NCTYPE(node)->ctype) {
case ONIGENC_CTYPE_WORD: case ONIGENC_CTYPE_WORD:
if (NCTYPE(node)->not != 0) { if (NCTYPE(node)->is_not != 0) {
for (i = 0; i < SINGLE_BYTE_SIZE; i++) { for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
if (! ONIGENC_IS_CODE_WORD(env->enc, i)) { if (! ONIGENC_IS_CODE_WORD(env->enc, i)) {
add_char_opt_map_info(&opt->map, (UChar )i, env->enc); add_char_opt_map_info(&opt->map, (UChar )i, env->enc);
...@@ -6170,7 +6170,7 @@ print_indent_tree(FILE* f, Node* node, int indent) ...@@ -6170,7 +6170,7 @@ print_indent_tree(FILE* f, Node* node, int indent)
fprintf(f, "<ctype:%x> ", (int )node); fprintf(f, "<ctype:%x> ", (int )node);
switch (NCTYPE(node)->ctype) { switch (NCTYPE(node)->ctype) {
case ONIGENC_CTYPE_WORD: case ONIGENC_CTYPE_WORD:
if (NCTYPE(node)->not != 0) if (NCTYPE(node)->is_not != 0)
fputs("not word", f); fputs("not word", f);
else else
fputs("word", f); fputs("word", f);
......
...@@ -1151,7 +1151,7 @@ node_new_cclass(void) ...@@ -1151,7 +1151,7 @@ node_new_cclass(void)
} }
static Node* static Node*
node_new_cclass_by_codepoint_range(int not, OnigCodePoint sb_out, node_new_cclass_by_codepoint_range(int is_not, OnigCodePoint sb_out,
const OnigCodePoint ranges[]) const OnigCodePoint ranges[])
{ {
int n, i; int n, i;
...@@ -1162,7 +1162,7 @@ node_new_cclass_by_codepoint_range(int not, OnigCodePoint sb_out, ...@@ -1162,7 +1162,7 @@ node_new_cclass_by_codepoint_range(int not, OnigCodePoint sb_out,
CHECK_NULL_RETURN(node); CHECK_NULL_RETURN(node);
cc = NCCLASS(node); cc = NCCLASS(node);
if (not != 0) NCCLASS_SET_NOT(cc); if (is_not != 0) NCCLASS_SET_NOT(cc);
BITSET_CLEAR(cc->bs); BITSET_CLEAR(cc->bs);
if (sb_out > 0 && IS_NOT_NULL(ranges)) { if (sb_out > 0 && IS_NOT_NULL(ranges)) {
...@@ -1201,14 +1201,14 @@ node_new_cclass_by_codepoint_range(int not, OnigCodePoint sb_out, ...@@ -1201,14 +1201,14 @@ node_new_cclass_by_codepoint_range(int not, OnigCodePoint sb_out,
} }
static Node* static Node*
node_new_ctype(int type, int not) node_new_ctype(int type, int is_not)
{ {
Node* node = node_new(); Node* node = node_new();
CHECK_NULL_RETURN(node); CHECK_NULL_RETURN(node);
SET_NTYPE(node, NT_CTYPE); SET_NTYPE(node, NT_CTYPE);
NCTYPE(node)->ctype = type; NCTYPE(node)->ctype = type;
NCTYPE(node)->not = not; NCTYPE(node)->is_not = is_not;
return node; return node;
} }
...@@ -2285,7 +2285,7 @@ typedef struct { ...@@ -2285,7 +2285,7 @@ typedef struct {
} call; } call;
struct { struct {
int ctype; int ctype;
int not; int is_not;
} prop; } prop;
} u; } u;
} OnigToken; } OnigToken;
...@@ -2954,45 +2954,45 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) ...@@ -2954,45 +2954,45 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
switch (c) { switch (c) {
case 'w': case 'w':
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_W; tok->u.prop.ctype = ONIGENC_CTYPE_W;
tok->u.prop.not = 0; tok->u.prop.is_not = 0;
break; break;
case 'W': case 'W':
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_W; tok->u.prop.ctype = ONIGENC_CTYPE_W;
tok->u.prop.not = 1; tok->u.prop.is_not = 1;
break; break;
case 'd': case 'd':
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_D; tok->u.prop.ctype = ONIGENC_CTYPE_D;
tok->u.prop.not = 0; tok->u.prop.is_not = 0;
break; break;
case 'D': case 'D':
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_D; tok->u.prop.ctype = ONIGENC_CTYPE_D;
tok->u.prop.not = 1; tok->u.prop.is_not = 1;
break; break;
case 's': case 's':
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_S; tok->u.prop.ctype = ONIGENC_CTYPE_S;
tok->u.prop.not = 0; tok->u.prop.is_not = 0;
break; break;
case 'S': case 'S':
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_S; tok->u.prop.ctype = ONIGENC_CTYPE_S;
tok->u.prop.not = 1; tok->u.prop.is_not = 1;
break; break;
case 'h': case 'h':
if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break; if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT; tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;
tok->u.prop.not = 0; tok->u.prop.is_not = 0;
break; break;
case 'H': case 'H':
if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break; if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT; tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;
tok->u.prop.not = 1; tok->u.prop.is_not = 1;
break; break;
case 'p': case 'p':
...@@ -3002,12 +3002,12 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) ...@@ -3002,12 +3002,12 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) { IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) {
PINC; PINC;
tok->type = TK_CHAR_PROPERTY; tok->type = TK_CHAR_PROPERTY;
tok->u.prop.not = (c == 'P' ? 1 : 0); tok->u.prop.is_not = (c == 'P' ? 1 : 0);
if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) { if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) {
PFETCH(c2); PFETCH(c2);
if (c2 == '^') { if (c2 == '^') {
tok->u.prop.not = (tok->u.prop.not == 0 ? 1 : 0); tok->u.prop.is_not = (tok->u.prop.is_not == 0 ? 1 : 0);
} }
else else
PUNFETCH; PUNFETCH;
...@@ -3244,15 +3244,15 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) ...@@ -3244,15 +3244,15 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
case 'w': case 'w':
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) break; if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) break;
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_W; tok->u.prop.ctype = ONIGENC_CTYPE_W;
tok->u.prop.not = 0; tok->u.prop.is_not = 0;
break; break;
case 'W': case 'W':
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) break; if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) break;
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_W; tok->u.prop.ctype = ONIGENC_CTYPE_W;
tok->u.prop.not = 1; tok->u.prop.is_not = 1;
break; break;
case 'b': case 'b':
...@@ -3284,43 +3284,43 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) ...@@ -3284,43 +3284,43 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
case 's': case 's':
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) break; if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) break;
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_S; tok->u.prop.ctype = ONIGENC_CTYPE_S;
tok->u.prop.not = 0; tok->u.prop.is_not = 0;
break; break;
case 'S': case 'S':
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) break; if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) break;
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_S; tok->u.prop.ctype = ONIGENC_CTYPE_S;
tok->u.prop.not = 1; tok->u.prop.is_not = 1;
break; break;
case 'd': case 'd':
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) break; if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) break;
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_D; tok->u.prop.ctype = ONIGENC_CTYPE_D;
tok->u.prop.not = 0; tok->u.prop.is_not = 0;
break; break;
case 'D': case 'D':
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) break; if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) break;
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_D; tok->u.prop.ctype = ONIGENC_CTYPE_D;
tok->u.prop.not = 1; tok->u.prop.is_not = 1;
break; break;
case 'h': case 'h':
if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break; if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT; tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;
tok->u.prop.not = 0; tok->u.prop.is_not = 0;
break; break;
case 'H': case 'H':
if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break; if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;
tok->type = TK_CHAR_TYPE; tok->type = TK_CHAR_TYPE;
tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT; tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;
tok->u.prop.not = 1; tok->u.prop.is_not = 1;
break; break;
case 'A': case 'A':
...@@ -3574,12 +3574,12 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) ...@@ -3574,12 +3574,12 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) { IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) {
PINC; PINC;
tok->type = TK_CHAR_PROPERTY; tok->type = TK_CHAR_PROPERTY;
tok->u.prop.not = (c == 'P' ? 1 : 0); tok->u.prop.is_not = (c == 'P' ? 1 : 0);
if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) { if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) {
PFETCH(c); PFETCH(c);
if (c == '^') { if (c == '^') {
tok->u.prop.not = (tok->u.prop.not == 0 ? 1 : 0); tok->u.prop.is_not = (tok->u.prop.is_not == 0 ? 1 : 0);
} }
else else
PUNFETCH; PUNFETCH;
...@@ -3773,7 +3773,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) ...@@ -3773,7 +3773,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
} }
static int static int
add_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int not, add_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int is_not,
ScanEnv* env, ScanEnv* env,
OnigCodePoint sb_out, const OnigCodePoint mbr[]) OnigCodePoint sb_out, const OnigCodePoint mbr[])
{ {
...@@ -3782,7 +3782,7 @@ add_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int not, ...@@ -3782,7 +3782,7 @@ add_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int not,
int n = ONIGENC_CODE_RANGE_NUM(mbr); int n = ONIGENC_CODE_RANGE_NUM(mbr);
if (not == 0) { if (is_not == 0) {
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
for (j = ONIGENC_CODE_RANGE_FROM(mbr, i); for (j = ONIGENC_CODE_RANGE_FROM(mbr, i);
j <= ONIGENC_CODE_RANGE_TO(mbr, i); j++) { j <= ONIGENC_CODE_RANGE_TO(mbr, i); j++) {
...@@ -3846,7 +3846,7 @@ add_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int not, ...@@ -3846,7 +3846,7 @@ add_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int not,
} }
static int static int
add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env) add_ctype_to_cc(CClassNode* cc, int ctype, int is_not, ScanEnv* env)
{ {
int c, r; int c, r;
const OnigCodePoint *ranges; const OnigCodePoint *ranges;
...@@ -3858,7 +3858,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env) ...@@ -3858,7 +3858,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env)
case ONIGENC_CTYPE_S: case ONIGENC_CTYPE_S:
case ONIGENC_CTYPE_W: case ONIGENC_CTYPE_W:
ctype ^= ONIGENC_CTYPE_SPECIAL_MASK; ctype ^= ONIGENC_CTYPE_SPECIAL_MASK;
if (not != 0) { if (is_not != 0) {
for (c = 0; c < SINGLE_BYTE_SIZE; c++) { for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
if (! ONIGENC_IS_ASCII_CODE_CTYPE((OnigCodePoint )c, ctype)) if (! ONIGENC_IS_ASCII_CODE_CTYPE((OnigCodePoint )c, ctype))
BITSET_SET_BIT_CHKDUP(cc->bs, c); BITSET_SET_BIT_CHKDUP(cc->bs, c);
...@@ -3877,7 +3877,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env) ...@@ -3877,7 +3877,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env)
r = ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, &sb_out, &ranges); r = ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, &sb_out, &ranges);
if (r == 0) { if (r == 0) {
return add_ctype_to_cc_by_range(cc, ctype, not, env, sb_out, ranges); return add_ctype_to_cc_by_range(cc, ctype, is_not, env, sb_out, ranges);
} }
else if (r != ONIG_NO_SUPPORT_CONFIG) { else if (r != ONIG_NO_SUPPORT_CONFIG) {
return r; return r;
...@@ -3896,7 +3896,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env) ...@@ -3896,7 +3896,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env)
case ONIGENC_CTYPE_XDIGIT: case ONIGENC_CTYPE_XDIGIT:
case ONIGENC_CTYPE_ASCII: case ONIGENC_CTYPE_ASCII:
case ONIGENC_CTYPE_ALNUM: case ONIGENC_CTYPE_ALNUM:
if (not != 0) { if (is_not != 0) {
for (c = 0; c < SINGLE_BYTE_SIZE; c++) { for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype)) if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype))
BITSET_SET_BIT_CHKDUP(cc->bs, c); BITSET_SET_BIT_CHKDUP(cc->bs, c);
...@@ -3913,7 +3913,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env) ...@@ -3913,7 +3913,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env)
case ONIGENC_CTYPE_GRAPH: case ONIGENC_CTYPE_GRAPH:
case ONIGENC_CTYPE_PRINT: case ONIGENC_CTYPE_PRINT:
if (not != 0) { if (is_not != 0) {
for (c = 0; c < SINGLE_BYTE_SIZE; c++) { for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype)) if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype))
BITSET_SET_BIT_CHKDUP(cc->bs, c); BITSET_SET_BIT_CHKDUP(cc->bs, c);
...@@ -3929,7 +3929,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env) ...@@ -3929,7 +3929,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env)
break; break;
case ONIGENC_CTYPE_WORD: case ONIGENC_CTYPE_WORD:
if (not == 0) { if (is_not == 0) {
for (c = 0; c < SINGLE_BYTE_SIZE; c++) { for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
if (IS_CODE_SB_WORD(enc, c)) BITSET_SET_BIT_CHKDUP(cc->bs, c); if (IS_CODE_SB_WORD(enc, c)) BITSET_SET_BIT_CHKDUP(cc->bs, c);
} }
...@@ -3977,7 +3977,7 @@ parse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env) ...@@ -3977,7 +3977,7 @@ parse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env)
}; };
const PosixBracketEntryType *pb; const PosixBracketEntryType *pb;
int not, i, r; int is_not, i, r;
OnigCodePoint c; OnigCodePoint c;
OnigEncoding enc = env->enc; OnigEncoding enc = env->enc;
UChar *p = *src; UChar *p = *src;
...@@ -3985,10 +3985,10 @@ parse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env) ...@@ -3985,10 +3985,10 @@ parse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env)
if (PPEEK_IS('^')) { if (PPEEK_IS('^')) {
PINC; PINC;
not = 1; is_not = 1;
} }
else else
not = 0; is_not = 0;
if (onigenc_strlen(enc, p, end) < POSIX_BRACKET_NAME_MIN_LEN + 3) if (onigenc_strlen(enc, p, end) < POSIX_BRACKET_NAME_MIN_LEN + 3)
goto not_posix_bracket; goto not_posix_bracket;
...@@ -3999,7 +3999,7 @@ parse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env) ...@@ -3999,7 +3999,7 @@ parse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env)
if (onigenc_with_ascii_strncmp(enc, p, end, (UChar* )":]", 2) != 0) if (onigenc_with_ascii_strncmp(enc, p, end, (UChar* )":]", 2) != 0)
return ONIGERR_INVALID_POSIX_BRACKET_TYPE; return ONIGERR_INVALID_POSIX_BRACKET_TYPE;
r = add_ctype_to_cc(cc, pb->ctype, not, env); r = add_ctype_to_cc(cc, pb->ctype, is_not, env);
if (r != 0) return r; if (r != 0) return r;
PINC; PINC; PINC; PINC;
...@@ -4074,7 +4074,7 @@ parse_char_property(Node** np, OnigToken* tok, UChar** src, UChar* end, ...@@ -4074,7 +4074,7 @@ parse_char_property(Node** np, OnigToken* tok, UChar** src, UChar* end,
cc = NCCLASS(*np); cc = NCCLASS(*np);
r = add_ctype_to_cc(cc, ctype, 0, env); r = add_ctype_to_cc(cc, ctype, 0, env);
if (r != 0) return r; if (r != 0) return r;
if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc); if (tok->u.prop.is_not != 0) NCCLASS_SET_NOT(cc);
return 0; return 0;
} }
...@@ -4356,7 +4356,7 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end, ...@@ -4356,7 +4356,7 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
break; break;
case TK_CHAR_TYPE: case TK_CHAR_TYPE:
r = add_ctype_to_cc(cc, tok->u.prop.ctype, tok->u.prop.not, env); r = add_ctype_to_cc(cc, tok->u.prop.ctype, tok->u.prop.is_not, env);
if (r != 0) return r; if (r != 0) return r;
next_class: next_class:
...@@ -4370,7 +4370,7 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end, ...@@ -4370,7 +4370,7 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
ctype = fetch_char_property_to_ctype(&p, end, env); ctype = fetch_char_property_to_ctype(&p, end, env);
if (ctype < 0) return ctype; if (ctype < 0) return ctype;
r = add_ctype_to_cc(cc, ctype, tok->u.prop.not, env); r = add_ctype_to_cc(cc, ctype, tok->u.prop.is_not, env);
if (r != 0) return r; if (r != 0) return r;
goto next_class; goto next_class;
} }
...@@ -4881,15 +4881,15 @@ set_quantifier(Node* qnode, Node* target, int group, ScanEnv* env) ...@@ -4881,15 +4881,15 @@ set_quantifier(Node* qnode, Node* target, int group, ScanEnv* env)
typedef struct { typedef struct {
OnigEncoding enc; OnigEncoding enc;
int not; int is_not;
int type; int type;
} type_cclass_key; } type_cclass_key;
static int type_cclass_cmp(type_cclass_key* x, type_cclass_key* y) static int type_cclass_cmp(type_cclass_key* x, type_cclass_key* y)
{ {
if (x->type != y->type) return 1; if (x->type != y->type) return 1;
if (x->enc != y->enc) return 1; if (x->enc != y->enc) return 1;
if (x->not != y->not) return 1; if (x->is_not != y->is_not) return 1;
return 0; return 0;
} }
...@@ -4910,7 +4910,7 @@ static st_index_t type_cclass_hash(type_cclass_key* key) ...@@ -4910,7 +4910,7 @@ static st_index_t type_cclass_hash(type_cclass_key* key)
val = val * 997 + (int )*p++; val = val * 997 + (int )*p++;
} }
val += key->not; val += key->is_not;
return val + (val >> 5); return val + (val >> 5);
} }
...@@ -5208,12 +5208,12 @@ parse_exp(Node** np, OnigToken* tok, int term, ...@@ -5208,12 +5208,12 @@ parse_exp(Node** np, OnigToken* tok, int term,
CHECK_NULL_RETURN_MEMERR(*np); CHECK_NULL_RETURN_MEMERR(*np);
cc = NCCLASS(*np); cc = NCCLASS(*np);
add_ctype_to_cc(cc, tok->u.prop.ctype, 0, env); add_ctype_to_cc(cc, tok->u.prop.ctype, 0, env);
if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc); if (tok->u.prop.is_not != 0) NCCLASS_SET_NOT(cc);
} }
break; break;
case ONIGENC_CTYPE_WORD: case ONIGENC_CTYPE_WORD:
*np = node_new_ctype(tok->u.prop.ctype, tok->u.prop.not); *np = node_new_ctype(tok->u.prop.ctype, tok->u.prop.is_not);
CHECK_NULL_RETURN_MEMERR(*np); CHECK_NULL_RETURN_MEMERR(*np);
break; break;
...@@ -5235,9 +5235,9 @@ parse_exp(Node** np, OnigToken* tok, int term, ...@@ -5235,9 +5235,9 @@ parse_exp(Node** np, OnigToken* tok, int term,
type_cclass_key key; type_cclass_key key;
type_cclass_key* new_key; type_cclass_key* new_key;
key.enc = env->enc; key.enc = env->enc;
key.not = tok->u.prop.not; key.is_not = tok->u.prop.is_not;
key.type = tok->u.prop.ctype; key.type = tok->u.prop.ctype;
THREAD_ATOMIC_START; THREAD_ATOMIC_START;
...@@ -5257,7 +5257,7 @@ parse_exp(Node** np, OnigToken* tok, int term, ...@@ -5257,7 +5257,7 @@ parse_exp(Node** np, OnigToken* tok, int term,
} }
} }
*np = node_new_cclass_by_codepoint_range(tok->u.prop.not, *np = node_new_cclass_by_codepoint_range(tok->u.prop.is_not,
sb_out, mbr); sb_out, mbr);
if (IS_NULL(*np)) { if (IS_NULL(*np)) {
THREAD_ATOMIC_END; THREAD_ATOMIC_END;
...@@ -5279,7 +5279,7 @@ parse_exp(Node** np, OnigToken* tok, int term, ...@@ -5279,7 +5279,7 @@ parse_exp(Node** np, OnigToken* tok, int term,
CHECK_NULL_RETURN_MEMERR(*np); CHECK_NULL_RETURN_MEMERR(*np);
cc = NCCLASS(*np); cc = NCCLASS(*np);
add_ctype_to_cc(cc, tok->u.prop.ctype, 0, env); add_ctype_to_cc(cc, tok->u.prop.ctype, 0, env);
if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc); if (tok->u.prop.is_not != 0) NCCLASS_SET_NOT(cc);
#ifdef USE_SHARED_CCLASS_TABLE #ifdef USE_SHARED_CCLASS_TABLE
} }
#endif #endif
......
...@@ -247,7 +247,7 @@ typedef struct { ...@@ -247,7 +247,7 @@ typedef struct {
typedef struct { typedef struct {
NodeBase base; NodeBase base;
int ctype; int ctype;
int not; int is_not;
} CtypeNode; } CtypeNode;
typedef struct _Node { typedef struct _Node {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment