ruby-changes:27866
From: nagachika <ko1@a...>
Date: Mon, 25 Mar 2013 02:02:50 +0900 (JST)
Subject: [ruby-changes:27866] nagachika:r39918 (ruby_2_0_0): merge revision(s) 39677,39695: [Backport #8068]
nagachika 2013-03-25 02:02:39 +0900 (Mon, 25 Mar 2013) New Revision: 39918 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39918 Log: merge revision(s) 39677,39695: [Backport #8068] * complex.c: described syntax of string form. * rational.c: ditto. * complex.c: edited rdoc. * rational.c: ditto. Modified directories: branches/ruby_2_0_0/ Modified files: branches/ruby_2_0_0/ChangeLog branches/ruby_2_0_0/complex.c branches/ruby_2_0_0/rational.c branches/ruby_2_0_0/version.h Index: ruby_2_0_0/complex.c =================================================================== --- ruby_2_0_0/complex.c (revision 39917) +++ ruby_2_0_0/complex.c (revision 39918) @@ -483,6 +483,28 @@ f_complex_new2(VALUE klass, VALUE x, VAL https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/complex.c#L483 * * Complex(1, 2) #=> (1+2i) * Complex('1+2i') #=> (1+2i) + * + * Syntax of string form: + * + * string form = extra spaces , complex , extra spaces ; + * complex = real part | [ sign ] , imaginary part + * | real part , sign , imaginary part + * | rational , "@" , rational ; + * real part = rational ; + * imaginary part = imaginary unit | unsigned rational , imaginary unit ; + * rational = [ sign ] , unsigned rational ; + * unsigned rational = numerator | numerator , "/" , denominator ; + * numerator = integer part | fractional part | integer part , fractional part ; + * denominator = digits ; + * integer part = digits ; + * fractional part = "." , digits , [ ( "e" | "E" ) , [ sign ] , digits ] ; + * imaginary unit = "i" | "I" | "j" | "J" ; + * sign = "-" | "+" ; + * digits = digit , { digit | "_" , digit }; + * digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; + * extra spaces = ? \s* ? ; + * + * See String#to_c. */ static VALUE nucomp_f_complex(int argc, VALUE *argv, VALUE klass) @@ -1825,6 +1847,8 @@ string_to_c_strict(VALUE self) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/complex.c#L1847 * '-0.0-0.0i'.to_c #=> (-0.0-0.0i) * '1/2+3/4i'.to_c #=> ((1/2)+(3/4)*i) * 'ruby'.to_c #=> (0+0i) + * + * See Kernel.Complex. */ static VALUE string_to_c(VALUE self) Index: ruby_2_0_0/ChangeLog =================================================================== --- ruby_2_0_0/ChangeLog (revision 39917) +++ ruby_2_0_0/ChangeLog (revision 39918) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1 +Mon Mar 25 02:02:15 2013 Tadayoshi Funaba <tadf@d...> + + * complex.c: edited rdoc. + * rational.c: ditto. + +Mon Mar 25 02:02:15 2013 Tadayoshi Funaba <tadf@d...> + + * complex.c: described syntax of string form. + * rational.c: ditto. + Mon Mar 25 01:26:26 2013 Zachary Scott <zachary@z...> * lib/webrick/httpproxy.rb: Fix typos in HTTPProxyServer [Bug #8013] Index: ruby_2_0_0/version.h =================================================================== --- ruby_2_0_0/version.h (revision 39917) +++ ruby_2_0_0/version.h (revision 39918) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1 #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2013-03-25" -#define RUBY_PATCHLEVEL 95 +#define RUBY_PATCHLEVEL 96 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 3 Index: ruby_2_0_0/rational.c =================================================================== --- ruby_2_0_0/rational.c (revision 39917) +++ ruby_2_0_0/rational.c (revision 39918) @@ -571,6 +571,22 @@ f_rational_new_no_reduce2(VALUE klass, V https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/rational.c#L571 * * Rational(1, 2) #=> (1/2) * Rational('1/2') #=> (1/2) + * + * Syntax of string form: + * + * string form = extra spaces , rational , extra spaces ; + * rational = [ sign ] , unsigned rational ; + * unsigned rational = numerator | numerator , "/" , denominator ; + * numerator = integer part | fractional part | integer part , fractional part ; + * denominator = digits ; + * integer part = digits ; + * fractional part = "." , digits , [ ( "e" | "E" ) , [ sign ] , digits ] ; + * sign = "-" | "+" ; + * digits = digit , { digit | "_" , digit } ; + * digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; + * extra spaces = ? \s* ? ; + * + * See String#to_r. */ static VALUE nurat_f_rational(int argc, VALUE *argv, VALUE klass) @@ -2256,6 +2272,8 @@ string_to_r_strict(VALUE self) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/rational.c#L2272 * '21 june 09'.to_r #=> (21/1) * '21/06/09'.to_r #=> (7/2) * 'bwv 1079'.to_r #=> (0/1) + * + * See Kernel.Rational. */ static VALUE string_to_r(VALUE self) Property changes on: ruby_2_0_0 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r39677,39695 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/