ruby-changes:18738
From: tenderlove <ko1@a...>
Date: Thu, 3 Feb 2011 07:18:24 +0900 (JST)
Subject: [ruby-changes:18738] Ruby:r30765 (trunk): * re.c (Init_Regexp): added a constant for ARG_ENCODING_NONE
tenderlove 2011-02-03 07:18:14 +0900 (Thu, 03 Feb 2011) New Revision: 30765 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30765 Log: * re.c (Init_Regexp): added a constant for ARG_ENCODING_NONE [ruby-core:35054] * test/ruby/test_regexp.rb: corresponding test. Modified files: trunk/ChangeLog trunk/re.c trunk/test/ruby/test_regexp.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 30764) +++ ChangeLog (revision 30765) @@ -1,3 +1,10 @@ +Thu Feb 3 07:16:11 2011 Aaron Patterson <aaron@t...> + + * re.c (Init_Regexp): added a constant for ARG_ENCODING_NONE + [ruby-core:35054] + + * test/ruby/test_regexp.rb: corresponding test. + Thu Feb 3 07:02:16 2011 Aaron Patterson <aaron@t...> * ext/psych/lib/psych/visitors/to_ruby.rb: ARG_ENCODING_NONE regular Index: re.c =================================================================== --- re.c (revision 30764) +++ re.c (revision 30765) @@ -3562,6 +3562,7 @@ rb_define_const(rb_cRegexp, "EXTENDED", INT2FIX(ONIG_OPTION_EXTEND)); rb_define_const(rb_cRegexp, "MULTILINE", INT2FIX(ONIG_OPTION_MULTILINE)); rb_define_const(rb_cRegexp, "FIXEDENCODING", INT2FIX(ARG_ENCODING_FIXED)); + rb_define_const(rb_cRegexp, "NOENCODING", INT2FIX(ARG_ENCODING_NONE)); rb_global_variable(®_cache); Index: test/ruby/test_regexp.rb =================================================================== --- test/ruby/test_regexp.rb (revision 30764) +++ test/ruby/test_regexp.rb (revision 30765) @@ -11,6 +11,12 @@ $VERBOSE = @verbose end + def test_has_NOENCODING + assert Regexp::NOENCODING + re = //n + assert_equal Regexp::NOENCODING, re.options + end + def test_ruby_dev_999 assert_match(/(?<=a).*b/, "aab") assert_match(/(?<=\u3042).*b/, "\u3042ab") -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/