add pic_parse

This commit is contained in:
Yuichi Nishiwaki
2013-12-07 20:54:23 -08:00
parent a83627ef9c
commit 617ee5aa68
2 changed files with 14 additions and 0 deletions
+13
View File
@@ -431,3 +431,16 @@ pic_parse_cstr(pic_state *pic, const char *str, pic_value *v)
return r;
}
pic_value
pic_parse(pic_state *pic, const char *src)
{
pic_value vs;
int r;
r = pic_parse_cstr(pic, src, &vs);
if (r != 1) {
return pic_undef_value();
}
return pic_car(pic, vs);
}