summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authorgit <[email protected]>2024-01-07 15:50:59 +0000
committergit <[email protected]>2024-01-07 15:50:59 +0000
commit5b6167c25210d3022310009f091cf468dd527e62 ()
treea8ddb7ab33686d4aa5926f190da05131cb54bb02 /re.c
parentc30b8ae947e4e0e01df74b07282b27b1b1c70df8 (diff)
* expand tabs. [ci skip]
Please consider using misc/expand_tabs.rb as a pre-commit hook.
-rw-r--r--re.c94
1 files changed, 47 insertions, 47 deletions
@@ -3042,53 +3042,53 @@ escape_asis:
for (s = p+1; s < end; s++) {
switch(*s) {
- case 'x':
- local_extend = invert ? -1 : 1;
- break;
- case '-':
- invert = 1;
- break;
- case ':':
- case ')':
- if (local_extend == 0 ||
- (local_extend == -1 && !extended_mode) ||
- (local_extend == 1 && extended_mode)) {
- /* no changes to extended flag */
- goto fallthrough;
- }
-
- if (*s == ':') {
- /* change extended flag until ')' */
- int local_options = options;
- if (local_extend == 1) {
- local_options |= ONIG_OPTION_EXTEND;
- }
- else {
- local_options &= ~ONIG_OPTION_EXTEND;
- }
-
- rb_str_buf_cat(buf, (char *)&c, 1);
- int ret = unescape_nonascii0(&p, end, enc, buf, encp,
- has_property, err,
- local_options, 1);
- if (ret < 0) return ret;
- goto begin_scan;
- }
- else {
- /* change extended flag for rest of expression */
- extended_mode = local_extend == 1;
- goto fallthrough;
- }
- case 'i':
- case 'm':
- case 'a':
- case 'd':
- case 'u':
- /* other option flags, ignored during scanning */
- break;
- default:
- /* other character, no extended flag change*/
- goto fallthrough;
}
}
}