summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-06-16 11:29:47 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-06-16 11:34:11 +0900
commitd4d99dd6d7e1374af3e567b175035b36977337c4 (patch)
tree663ff774215ec09dedc2775b5c63c706ce7116aa /include
parent9e6a3f6c959bad02093cbe527b4ae753271f463e (diff)
downloadmruby-d4d99dd6d7e1374af3e567b175035b36977337c4.tar.gz
mruby-d4d99dd6d7e1374af3e567b175035b36977337c4.zip
Allow `break` from a block called by `mrb_yield`; close #3359
This means #3701 is now OK to merge.
Diffstat (limited to 'include')
-rw-r--r--include/mruby/error.h7
-rw-r--r--include/mruby/value.h3
2 files changed, 9 insertions, 1 deletions
diff --git a/include/mruby/error.h b/include/mruby/error.h
index bb67e7bd8..0a262550e 100644
--- a/include/mruby/error.h
+++ b/include/mruby/error.h
@@ -32,6 +32,13 @@ MRB_API mrb_noreturn void mrb_no_method_error(mrb_state *mrb, mrb_sym id, mrb_va
/* declaration for fail method */
MRB_API mrb_value mrb_f_raise(mrb_state*, mrb_value);
+struct RBreak {
+ MRB_OBJECT_HEADER;
+ struct iv_tbl *iv;
+ struct RProc *proc;
+ mrb_value val;
+};
+
/**
* Protect
*
diff --git a/include/mruby/value.h b/include/mruby/value.h
index a206be549..98c68d657 100644
--- a/include/mruby/value.h
+++ b/include/mruby/value.h
@@ -116,7 +116,8 @@ enum mrb_vtype {
MRB_TT_DATA, /* 21 */
MRB_TT_FIBER, /* 22 */
MRB_TT_ISTRUCT, /* 23 */
- MRB_TT_MAXDEFINE /* 24 */
+ MRB_TT_BREAK, /* 24 */
+ MRB_TT_MAXDEFINE /* 25 */
};
#include <mruby/object.h>