diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-07-03 20:59:07 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-07-03 20:59:07 +0900 |
| commit | 65096c4c1bd1bfb6f547808fc01ab6ea223d9dc6 (patch) | |
| tree | 5ed7ff2d2ddd0da12e0bcf9b7e09d48e15f1b2c8 /test/driver.c | |
| parent | ce49d90dc82bc165880a800ae95dc327b729143f (diff) | |
| download | mruby-65096c4c1bd1bfb6f547808fc01ab6ea223d9dc6.tar.gz mruby-65096c4c1bd1bfb6f547808fc01ab6ea223d9dc6.zip | |
add context to parser, that would hold local variable info, filename, and line number. mrbc_context argument has been added to mrb_parse_xxx() functions. Normally, you just to need to add NULL (or 0) to the last argument of the above functions.
Diffstat (limited to 'test/driver.c')
| -rw-r--r-- | test/driver.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/test/driver.c b/test/driver.c index 6b42d025b..6b1697f14 100644 --- a/test/driver.c +++ b/test/driver.c @@ -42,16 +42,8 @@ main(void) } mrb_init_mrbtest(mrb); - parser = mrb_parse_nstring(mrb, prog, strlen(prog)); - - /* generate bytecode */ - byte_code = mrb_generate_code(mrb, parser->tree); - - /* evaluate the bytecode */ - return_value = mrb_run(mrb, - /* pass a proc for evaulation */ - mrb_proc_new(mrb, mrb->irep[byte_code]), - mrb_top_self(mrb)); + /* evaluate the test */ + return_value = mrb_load_string(mrb, prog); /* did an exception occur? */ if (mrb->exc) { mrb_p(mrb, return_value); |
