diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-05-18 11:04:36 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-05-18 11:04:36 +0900 |
| commit | 61d8bb132e78d37670b0bc0055e5892eb5885e12 (patch) | |
| tree | 590d9ab9d349ed80b28943a7324b432fb46374fb /tools | |
| parent | a18fb01b03a837a30d16e229d99d547b82505de2 (diff) | |
| download | mruby-61d8bb132e78d37670b0bc0055e5892eb5885e12.tar.gz mruby-61d8bb132e78d37670b0bc0055e5892eb5885e12.zip | |
keep toplevel local variables; close #133
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/mirb/mirb.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/mirb/mirb.c b/tools/mirb/mirb.c index 11bdcfcf8..8c1978059 100644 --- a/tools/mirb/mirb.c +++ b/tools/mirb/mirb.c @@ -161,8 +161,10 @@ main(void) print_hint(); - /* new interpreter instance */ + /* new interpreter instance */ mrb_interpreter = mrb_open(); + /* new parser instance */ + parser = mrb_parser_new(mrb_interpreter); memset(ruby_code, 0, sizeof(*ruby_code)); memset(last_code_line, 0, sizeof(*last_code_line)); @@ -205,7 +207,10 @@ main(void) } /* parse code */ - parser = mrb_parse_nstring_ext(mrb_interpreter, ruby_code, strlen(ruby_code)); + parser->s = ruby_code; + parser->send = ruby_code + strlen(ruby_code); + parser->capture_errors = 1; + mrb_parser_parse(parser); code_block_open = is_code_block_open(parser); if (code_block_open) { |
