diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-08 07:07:03 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-08 07:07:03 +0000 |
commit | c186fdb90bfecb9ecc9a001796a19efca401dc4c (patch) | |
tree | 03303e152f40736509c468d6e97fef014cbf47c1 /include/ruby | |
parent | cc317d920817a169a8761c9e756082bcc126a1c1 (diff) | |
download | ruby-c186fdb90bfecb9ecc9a001796a19efca401dc4c.tar.gz |
* 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
Diffstat (limited to 'include/ruby')
-rw-r--r-- | include/ruby/ruby.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 905ff7d4a9..acb101a02d 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -798,6 +798,7 @@ RUBY_EXTERN VALUE rb_eFatal; RUBY_EXTERN VALUE rb_eArgError; RUBY_EXTERN VALUE rb_eEOFError; RUBY_EXTERN VALUE rb_eIndexError; +RUBY_EXTERN VALUE rb_eStopIteration; RUBY_EXTERN VALUE rb_eKeyError; RUBY_EXTERN VALUE rb_eRangeError; RUBY_EXTERN VALUE rb_eIOError; |