diff options
Diffstat (limited to 'py')
-rw-r--r-- | py/runtime.c | 4 | ||||
-rw-r--r-- | py/runtime.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c index 9da568876..a1bd67636 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -319,6 +319,10 @@ static bool fit_small_int(py_small_int_t o) { return true; } +py_obj_t py_obj_new_int(int value) { + return TO_SMALL_INT(value); +} + py_obj_t py_obj_new_const(const char *id) { py_obj_base_t *o = m_new(py_obj_base_t, 1); o->kind = O_CONST; diff --git a/py/runtime.h b/py/runtime.h index 326ca0833..98d77c8e7 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -99,6 +99,7 @@ void py_obj_print(py_obj_t o); int rt_is_true(py_obj_t arg); int py_get_int(py_obj_t arg); qstr py_get_qstr(py_obj_t arg); +py_obj_t py_obj_new_int(int value); py_obj_t rt_load_const_str(qstr qstr); py_obj_t rt_load_name(qstr qstr); py_obj_t rt_load_global(qstr qstr); |