summaryrefslogtreecommitdiff
path: root/py/emitglue.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-03-31 15:18:37 +0100
committerDamien George <damien.p.george@gmail.com>2014-03-31 15:18:37 +0100
commite337f1ef5efda000f0517b3d5e7aec5ba4ed8b55 (patch)
tree271c54bd70aa5c5bad3404fde2905a3ff5a9764e /py/emitglue.c
parent1aa2c1026348b057dca2008a165c6d4341a66606 (diff)
py: Towards default keyword arguments.
These are default arguments after a bare *.
Diffstat (limited to 'py/emitglue.c')
-rw-r--r--py/emitglue.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/py/emitglue.c b/py/emitglue.c
index 73304de27..dc084e159 100644
--- a/py/emitglue.c
+++ b/py/emitglue.c
@@ -190,13 +190,16 @@ void mp_emit_glue_assign_inline_asm_code(uint unique_code_id, void *fun, uint le
#endif
}
-mp_obj_t mp_make_function_from_id(uint unique_code_id, bool free_unique_code, mp_obj_t def_args) {
+mp_obj_t mp_make_function_from_id(uint unique_code_id, bool free_unique_code, mp_obj_t def_args, mp_obj_t def_kw_args) {
DEBUG_OP_printf("make_function_from_id %d\n", unique_code_id);
if (unique_code_id >= unique_codes_total) {
// illegal code id
return mp_const_none;
}
+ // TODO implement default kw args
+ assert(def_kw_args == MP_OBJ_NULL);
+
// make the function, depending on the code kind
mp_code_t *c = &unique_codes[unique_code_id];
mp_obj_t fun;
@@ -231,10 +234,10 @@ mp_obj_t mp_make_function_from_id(uint unique_code_id, bool free_unique_code, mp
return fun;
}
-mp_obj_t mp_make_closure_from_id(uint unique_code_id, mp_obj_t closure_tuple, mp_obj_t def_args) {
+mp_obj_t mp_make_closure_from_id(uint unique_code_id, mp_obj_t closure_tuple, mp_obj_t def_args, mp_obj_t def_kw_args) {
DEBUG_OP_printf("make_closure_from_id %d\n", unique_code_id);
// make function object
- mp_obj_t ffun = mp_make_function_from_id(unique_code_id, false, def_args);
+ mp_obj_t ffun = mp_make_function_from_id(unique_code_id, false, def_args, def_kw_args);
// wrap function in closure object
return mp_obj_new_closure(ffun, closure_tuple);
}