* expand tabs. [ci skip]
Please consider using misc/expand_tabs.rb as a pre-commit hook.
This commit is contained in:
parent
c30b8ae947
commit
5b6167c252
90
re.c
90
re.c
@ -3042,53 +3042,53 @@ escape_asis:
|
|||||||
|
|
||||||
for (s = p+1; s < end; s++) {
|
for (s = p+1; s < end; s++) {
|
||||||
switch(*s) {
|
switch(*s) {
|
||||||
case 'x':
|
case 'x':
|
||||||
local_extend = invert ? -1 : 1;
|
local_extend = invert ? -1 : 1;
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
invert = 1;
|
invert = 1;
|
||||||
break;
|
break;
|
||||||
case ':':
|
case ':':
|
||||||
case ')':
|
case ')':
|
||||||
if (local_extend == 0 ||
|
if (local_extend == 0 ||
|
||||||
(local_extend == -1 && !extended_mode) ||
|
(local_extend == -1 && !extended_mode) ||
|
||||||
(local_extend == 1 && extended_mode)) {
|
(local_extend == 1 && extended_mode)) {
|
||||||
/* no changes to extended flag */
|
/* no changes to extended flag */
|
||||||
goto fallthrough;
|
goto fallthrough;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*s == ':') {
|
if (*s == ':') {
|
||||||
/* change extended flag until ')' */
|
/* change extended flag until ')' */
|
||||||
int local_options = options;
|
int local_options = options;
|
||||||
if (local_extend == 1) {
|
if (local_extend == 1) {
|
||||||
local_options |= ONIG_OPTION_EXTEND;
|
local_options |= ONIG_OPTION_EXTEND;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
local_options &= ~ONIG_OPTION_EXTEND;
|
local_options &= ~ONIG_OPTION_EXTEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_str_buf_cat(buf, (char *)&c, 1);
|
rb_str_buf_cat(buf, (char *)&c, 1);
|
||||||
int ret = unescape_nonascii0(&p, end, enc, buf, encp,
|
int ret = unescape_nonascii0(&p, end, enc, buf, encp,
|
||||||
has_property, err,
|
has_property, err,
|
||||||
local_options, 1);
|
local_options, 1);
|
||||||
if (ret < 0) return ret;
|
if (ret < 0) return ret;
|
||||||
goto begin_scan;
|
goto begin_scan;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* change extended flag for rest of expression */
|
/* change extended flag for rest of expression */
|
||||||
extended_mode = local_extend == 1;
|
extended_mode = local_extend == 1;
|
||||||
goto fallthrough;
|
goto fallthrough;
|
||||||
}
|
}
|
||||||
case 'i':
|
case 'i':
|
||||||
case 'm':
|
case 'm':
|
||||||
case 'a':
|
case 'a':
|
||||||
case 'd':
|
case 'd':
|
||||||
case 'u':
|
case 'u':
|
||||||
/* other option flags, ignored during scanning */
|
/* other option flags, ignored during scanning */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* other character, no extended flag change*/
|
/* other character, no extended flag change*/
|
||||||
goto fallthrough;
|
goto fallthrough;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user