Add bin/mrbc --no-ext-ops switch

Print an error if `OP_EXT[123]` is needed when generating mruby binary.
This may be useful for mruby/c.

Inspired by #5590.
This commit is contained in:
dearblue
2021-12-17 23:02:04 +09:00
parent 9b65d0dc86
commit 6b8582c95d
5 changed files with 22 additions and 0 deletions
+2
View File
@@ -31,6 +31,7 @@ typedef struct mrbc_context {
mrb_bool no_exec:1;
mrb_bool keep_lv:1;
mrb_bool no_optimize:1;
mrb_bool no_ext_ops:1;
const struct RProc *upper;
size_t parser_nerr;
@@ -155,6 +156,7 @@ struct mrb_parser_state {
mrb_bool no_optimize:1;
mrb_bool capture_errors:1;
mrb_bool no_ext_ops:1;
const struct RProc *upper;
struct mrb_parser_message error_buffer[10];
struct mrb_parser_message warn_buffer[10];