Граф коммитов

758 Коммитов

Автор SHA1 Сообщение Дата
suke 32716144fd * ext/win32ole/win32ole.c (reg_get_value): use RegQueryValueEx instead
of RegQueryValueEx.

* ext/win32ole/win32ole.c (typelib_file_from_clsid): fix the bug
  that the function always returns Qnil.

* test/win32ole/test_win32ole_type.rb (test_initialize): add some test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-23 11:14:03 +00:00
matz 40b5c7b26c * util.c (ruby_strtod): replaced by the implementation by David
M. Gay inspired by William D. Clinger's paper "How to Read Floating
  Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101].
  a patch from Satoshi Nakagawa <snakagawa AT infoteria.co.jp>.
  [ruby-dev:31582]

* test/ruby/test_float.rb (TestFloat::test_float): add test for
  precision.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-21 20:57:48 +00:00
ko1 c5e4cd0638 * cont.c: add Fiber#resume and Fiber.yield.
and Fiber::Core class to realize Coroutine.
* include/ruby/intern.h: declare rb_fiber_yield(), rb_fiber_resume(),
* enumerator.c: use above api.
* test/ruby/test_fiber.rb: fix and add tests for above changes.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-21 18:51:39 +00:00
ko1 3fffbe1e82 * test/ruby/test_enumerator.rb: fix last commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 19:09:03 +00:00
ko1 2d3724e058 * test_enumerator.rb (enum_test): fix to return sorted
array (for Hash test).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 19:00:27 +00:00
ko1 ad56f8c611 * enumerator.c (next_i): fix to return with Fiber#yield at
the end of each block.  [ruby-dev:31470]
* enumerator.c (enumerator_next_p): call init_next if not
  initialized.  [ruby-dev:31514]
* test/ruby/test_enumerator.rb: add tests for Enumerator.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 18:58:32 +00:00
akr cf82149d21 Sentence.expand_syntax refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-19 15:43:04 +00:00
akr a854a4358f * test/ruby/sentence.rb: new method Sentence().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-19 03:37:14 +00:00
akr 9e5d0d861f sentence.rb documented.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 17:04:06 +00:00
akr 7017b63b81 * test/ruby/test_yield.rb (TestYieldGen): relax array size check
in nested parameters.
  [ruby-dev:31485]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 10:04:24 +00:00
akr 88e1fec393 lambda yield emulator refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 06:31:04 +00:00
akr f62fff5f41 * test/ruby/test_yield.rb (TestYieldGen): add test for yielding to
lambda using lambda parameter passing emulator.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 03:44:28 +00:00
nobu 54a3576eaa * sample/test.rb, test/ruby/test_system.rb(valid_syntax?): keep
comment lines first.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 03:24:32 +00:00
nobu 69dd06ae68 * eval.c (frame_func_id): return proper method ID.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-17 16:12:03 +00:00
ko1 ad272173cd * test/ruby/test_basicinstructions.rb: fix old tests.
class variables should be inherited.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-17 13:11:39 +00:00
akr c710449a85 fix "&" handling in block parameter.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-16 12:07:29 +00:00
akr 9a26bd3f57 * test/ruby/sentence.rb: Sentence class implemented
based on sentgen.rb

* test/ruby/sentgen.rb: removed.

* test/ruby/test_assignment.rb: use sentence.rb.

* test/ruby/test_yield.rb: block parameter passing emulator
  implemented.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-16 10:21:16 +00:00
akr aca2aa2457 TestRubyYieldGen#test_yield needs too long time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-15 05:17:06 +00:00
nobu 4edc1d8c9c * hash.c (rb_hash_delete_key): delete the entry without calling block.
* hash.c (rb_hash_shift): should consider iter_lev too.

* hash.c (delete_if_i): use rb_hash_delete_key() so that the block
  isn't called twice.  [ruby-core:11556]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-15 04:50:12 +00:00
kou 3349fd5826 * lib/rss/rss.rb: 0.1.8 -> 0.1.9.
* test/rss/test_version.rb: followed the above change.

* lib/rss/parser.rb: fixed a bug that handles unintended elements.
  Thanks to Takuo Yonezawa. [ruby-list:43841]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-13 15:06:58 +00:00
akr fb20d67ff5 update syntax (f_marg_list).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-09 06:15:44 +00:00
matz c186fdb90b * enumerator.c (enumerator_next_p): should check correctly even when
e.next has not been called before.

* enumerator.c (enumerator_next): raise StopIteration (name taken
  from Python) instead of IndexError.

* enum.c (enum_zip): catch StopIteration exception.

* enumerator.c (enumerator_with_index): return Enumerator if no
  block is given.

* test/ruby/test_iterator.rb (TestIterator::test_enumerator): add
  test for enumerators.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-08 07:07:03 +00:00
akr cc317d9208 variable renaming refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-08 04:45:15 +00:00
suke 785d6c7778 remove puts for debug
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-07 11:01:06 +00:00
suke f4a3bcbff0 fix test of PROPERTYPUT_REF in some environment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-06 11:37:22 +00:00
akr 7bc137942d add test using sentgen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-06 08:39:01 +00:00
tadf cbc22bf9bd added an assertion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-05 04:06:08 +00:00
kou 71976790ec * lib/rss, sample/rss, test/rss:
- 0.1.7 -> 0.1.8.
  - supported <itunes:XXX>.
  - reverted backward incompatibility API changes introduced 0.1.7.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-05 03:03:05 +00:00
nobu 46e848a65a * sprintf.c (rb_f_sprintf): should not check positional number as
width.  [ruby-core:11838]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-02 04:46:41 +00:00
nobu 12b1e59f2e * generic.rb (URI::Generic::merge_path): behave as RFC 3986.
[ruby-talk:252052]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-01 03:40:08 +00:00
akr 8721f3983d add assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-30 03:45:05 +00:00
nobu 798b8d2791 * bignum.c (rb_big_aref): check for Bignum index range.
[ruby-dev:31271]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-30 02:16:42 +00:00
akr 863e7e95f2 refine tests for shift.
more tests for string to integer conversion.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-19 17:04:53 +00:00
nobu 09ce106ab3 * bignum.c (rb_big_lshift, rb_big_rshift): separated functions
to get rid of infinite recursion.  fixed calculation in edge
  cases.  [ruby-dev:31244]

* numeric.c (rb_fix_lshift, rb_fix_rshift): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-19 05:38:48 +00:00
nobu 192c936e23 * sprintf.c (rb_f_sprintf): more checks for format argument.
[ruby-core:11569], [ruby-core:11570], [ruby-core:11571],
  [ruby-core:11573]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15 20:45:55 +00:00
akr 746a7ec4f6 refine failure messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15 12:15:42 +00:00
nobu b64881077e * bignum.c (rb_cstr_to_inum): check leading non-digits.
[ruby-core:11691]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15 10:05:37 +00:00
akr 3c883bdd17 refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15 01:20:56 +00:00
matz 7f0bb427e0 * numeric.c (fix_pow): integer power calculation: 0**n => 0,
1**n => 1, -1**n => 1 (n: even) / -1 (n: odd).

* test/ruby/test_fixnum.rb (TestFixnum::test_pow): update test
  suite.  pow(-3, 2^64) gives NaN when pow(3, 2^64) gives Inf.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-14 14:31:21 +00:00
akr 75d484a453 more assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-14 04:13:12 +00:00
akr 3a4e0f1f5a refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 16:34:19 +00:00
akr 4122a13560 check values around 16bit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 15:20:49 +00:00
akr 744701f404 more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 14:50:06 +00:00
akr 3cf28c2caa add assertions using equations taken from Hacker's Delight.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 13:31:41 +00:00
akr 71467c78c2 new file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 12:51:27 +00:00
akr d2113feba8 more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 10:21:50 +00:00
akr c6818f4104 check (-0x4000000000000000)/(-1) too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 09:35:29 +00:00
akr c393603f94 add test for [ruby-dev:31210].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 09:33:17 +00:00
akr a309f10475 sentence generator updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 08:40:09 +00:00
akr 091fb1c2e4 add test for [ruby-dev:31197].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 03:47:18 +00:00