summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-24 05:20:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-24 05:20:48 +0000
commit04726dd749f1f93eca39584311e224e2465fca5c (patch)
treecc2b54cfaafdca60b6aa95624c9606de00666584 /ext
parentd03199b6d6cedc9c5d1059aa58e5211af6b479b3 (diff)
* vm.c (rb_iter_break_value): new function to break a block with
the value. [ruby-dev:45132] [Feature #5895] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/-test-/iter/break.c15
-rw-r--r--ext/-test-/iter/extconf.rb1
2 files changed, 16 insertions, 0 deletions
diff --git a/ext/-test-/iter/break.c b/ext/-test-/iter/break.c
new file mode 100644
index 0000000000..78c7da6491
--- /dev/null
+++ b/ext/-test-/iter/break.c
@@ -0,0 +1,15 @@
+#include <ruby.h>
+
+static VALUE
+iter_break_value(VALUE self, VALUE val)
+{
+ rb_iter_break_value(val);
+ return self; /* not reached */
+}
+
+void
+Init_break(void)
+{
+ VALUE breakable = rb_define_module_under(rb_define_module("Bug"), "Breakable");
+ rb_define_module_function(breakable, "iter_break", iter_break_value, 1);
+}
diff --git a/ext/-test-/iter/extconf.rb b/ext/-test-/iter/extconf.rb
new file mode 100644
index 0000000000..695b5e9f6d
--- /dev/null
+++ b/ext/-test-/iter/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/iter/break")