From 66028ab6dcd1b2ec9504c3473d817649935a4a1e Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 3 Jan 2014 14:03:48 +0000 Subject: Basic implementation of import. import works for simple cases. Still work to do on finding the right script, and setting globals/locals correctly when running an imported function. --- py/obj.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'py/obj.h') diff --git a/py/obj.h b/py/obj.h index 6a0cefd91..7b4b0656f 100644 --- a/py/obj.h +++ b/py/obj.h @@ -215,11 +215,14 @@ mp_obj_t mp_obj_dict_store(mp_obj_t self_in, mp_obj_t key, mp_obj_t value); void mp_obj_set_store(mp_obj_t self_in, mp_obj_t item); // functions -typedef struct _mp_obj_fun_native_t { // need this so we can define static objects +typedef struct _mp_obj_fun_native_t { // need this so we can define const objects (to go in ROM) mp_obj_base_t base; machine_uint_t n_args_min; // inclusive machine_uint_t n_args_max; // inclusive void *fun; + // TODO add mp_map_t *globals + // for const function objects, make an empty, const map + // such functions won't be able to access the global scope, but that's probably okay } mp_obj_fun_native_t; extern const mp_obj_type_t fun_native_type; extern const mp_obj_type_t fun_bc_type; -- cgit v1.2.3