diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-06-28 16:04:40 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-06-28 16:04:40 +0900 |
| commit | aee1476ebdafd842f9805b470996f4882eb5b6d9 (patch) | |
| tree | c6728b69a3a534171241aaf9cbe3c14952e8abdb /include | |
| parent | 15945e14b91151e5d52f26ea76cb511f0d98fa03 (diff) | |
| download | mruby-aee1476ebdafd842f9805b470996f4882eb5b6d9.tar.gz mruby-aee1476ebdafd842f9805b470996f4882eb5b6d9.zip | |
Provide better way to check compile errors.
Now you can just call `mrb_load_*` functions then check
`context->parser_nerr > 0` if the return value is `undef`,
instead of calling `mrb_parse_*` functions independently.
ref #3248 #3331
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby/compile.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/mruby/compile.h b/include/mruby/compile.h index ad3f19db1..13e04d0fc 100644 --- a/include/mruby/compile.h +++ b/include/mruby/compile.h @@ -33,6 +33,8 @@ typedef struct mrbc_context { mrb_bool no_exec:1; mrb_bool keep_lv:1; mrb_bool no_optimize:1; + + size_t parser_nerr; } mrbc_context; MRB_API mrbc_context* mrbc_context_new(mrb_state *mrb); |
