mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* re.c (rb_reg_desc): separate RE_OPTION_MULTILINE
* re.c (rb_reg_options): add RE_OPTION_{POSIXLINE,RE_OPTION_MULTILINE, RE_OPTION_EXTENDED} git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e63525e97e
commit
e9c8b36b1e
1 changed files with 8 additions and 2 deletions
10
re.c
10
re.c
|
@ -288,11 +288,11 @@ rb_reg_desc(s, len, re)
|
|||
rb_str_cat2(str, "/");
|
||||
if (re) {
|
||||
rb_reg_check(re);
|
||||
if (RREGEXP(re)->ptr->options & RE_OPTION_MULTILINE)
|
||||
rb_str_cat2(str, "m");
|
||||
/* /p is obsolete; to be removed */
|
||||
if ((RREGEXP(re)->ptr->options & RE_OPTION_POSIXLINE) == RE_OPTION_POSIXLINE)
|
||||
rb_str_cat2(str, "p");
|
||||
else if (RREGEXP(re)->ptr->options & RE_OPTION_MULTILINE)
|
||||
rb_str_cat2(str, "m");
|
||||
if (RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE)
|
||||
rb_str_cat2(str, "i");
|
||||
if (RREGEXP(re)->ptr->options & RE_OPTION_EXTENDED)
|
||||
|
@ -1136,6 +1136,12 @@ rb_reg_options(re)
|
|||
rb_reg_check(re);
|
||||
if (RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE)
|
||||
options |= RE_OPTION_IGNORECASE;
|
||||
if ((RREGEXP(re)->ptr->options & RE_OPTION_POSIXLINE) == RE_OPTION_POSIXLINE)
|
||||
options |= RE_OPTION_POSIXLINE;
|
||||
else if (RREGEXP(re)->ptr->options & RE_OPTION_MULTILINE)
|
||||
options |= RE_OPTION_MULTILINE;
|
||||
if (RREGEXP(re)->ptr->options & RE_OPTION_EXTENDED)
|
||||
options |= RE_OPTION_EXTENDED;
|
||||
if (FL_TEST(re, KCODE_FIXED)) {
|
||||
options |= rb_reg_get_kcode(re);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue