[macruby-changes] [3644] MacRuby/branches/icu/re.cpp
source_changes at macosforge.org
source_changes at macosforge.org
Fri Feb 26 19:13:34 PST 2010
Revision: 3644
http://trac.macosforge.org/projects/ruby/changeset/3644
Author: lsansonetti at apple.com
Date: 2010-02-26 19:13:34 -0800 (Fri, 26 Feb 2010)
Log Message:
-----------
use UREGEX_MULTILINE by default and UREGEX_DOTALL in case /m is passed, to follow MRI's weird behavior
Modified Paths:
--------------
MacRuby/branches/icu/re.cpp
Modified: MacRuby/branches/icu/re.cpp
===================================================================
--- MacRuby/branches/icu/re.cpp 2010-02-27 03:12:52 UTC (rev 3643)
+++ MacRuby/branches/icu/re.cpp 2010-02-27 03:13:34 UTC (rev 3644)
@@ -28,6 +28,11 @@
#define RREGEXP(o) ((rb_regexp_t *)o)
+#define REGEXP_OPT_DEFAULT (UREGEX_MULTILINE)
+#define REGEXP_OPT_IGNORECASE (UREGEX_CASE_INSENSITIVE)
+#define REGEXP_OPT_EXTENDED (UREGEX_COMMENTS)
+#define REGEXP_OPT_MULTILINE (UREGEX_DOTALL)
+
typedef struct rb_match {
struct RBasic basic;
rb_regexp_t *regexp;
@@ -148,6 +153,8 @@
static bool
init_from_string(rb_regexp_t *regexp, VALUE str, int option, VALUE *excp)
{
+ option |= REGEXP_OPT_DEFAULT;
+
UnicodeString *unistr = str_to_unistr(str);
assert(unistr != NULL);
@@ -193,10 +200,6 @@
return (VALUE)regexp;
}
-#define REGEXP_OPT_IGNORECASE (UREGEX_CASE_INSENSITIVE)
-#define REGEXP_OPT_EXTENDED (UREGEX_COMMENTS)
-#define REGEXP_OPT_MULTILINE (UREGEX_MULTILINE | UREGEX_DOTALL)
-
bool
rb_char_to_icu_option(int c, int *option)
{
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100226/a34cde4c/attachment.html>
More information about the macruby-changes
mailing list