/programs/develop/tinypy/tinypy/builtins.c |
---|
10,6 → 10,19 |
return tp_None; |
} |
#define BUF_SIZE 2048 |
tp_obj tp_raw_input(TP) { |
tp_obj prompt; |
char *buf = malloc(BUF_SIZE); |
if (tp->params.list.val->len) |
{ |
prompt = TP_OBJ(); |
con_printf("%s", TP_CSTR(prompt)); |
} |
con_gets(buf, BUF_SIZE); |
return tp_string(buf); |
} |
tp_obj tp_bind(TP) { |
tp_obj r = TP_OBJ(); |
tp_obj self = TP_OBJ(); |
/programs/develop/tinypy/tinypy/vm.c |
---|
325,8 → 325,8 |
void tp_builtins(TP) { |
struct {const char *s;void *f;} b[] = { |
{"print",tp_print}, {"range",tp_range}, {"min",tp_min}, |
{"max",tp_max}, {"bind",tp_bind}, {"copy",tp_copy}, |
{"print",tp_print}, {"range",tp_range}, {"raw_input", tp_raw_input}, |
{"min",tp_min}, {"max",tp_max}, {"bind",tp_bind}, {"copy",tp_copy}, |
{"import",tp_import_}, {"len",tp_len_}, {"assert",tp_assert}, |
{"str",tp_str2}, {"float",tp_float}, {"system",tp_system}, |
{"istype",tp_istype}, {"chr",tp_chr}, {"save",tp_save}, |