From 65096c4c1bd1bfb6f547808fc01ab6ea223d9dc6 Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Tue, 3 Jul 2012 20:59:07 +0900 Subject: 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. --- test/driver.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'test') 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); -- cgit v1.2.3