Commit d1eea450 authored by take_cheeze's avatar take_cheeze Committed by Yukihiro "Matz" Matsumoto

Use `mrb_parse_nstring` instead in eval.

parent 42110dce
......@@ -113,10 +113,12 @@ create_proc_from_string(mrb_state *mrb, char *s, int len, mrb_value binding, cha
mrbc_filename(mrb, cxt, file);
}
p = mrb_parser_new(mrb);
p->s = s;
p->send = s + len;
mrb_parser_parse(p, cxt);
p = mrb_parse_nstring(mrb, s, len, cxt);
/* only occur when memory ran out */
if (!p) {
mrb_raise(mrb, E_RUNTIME_ERROR, "Failed to create parser state.");
}
if (0 < p->nerr) {
/* parse error */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment