diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-04-27 15:50:52 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-04-27 15:50:52 +0100 |
| commit | 2827d62e8b5790b2d770b9ce54e25cd56e949f20 (patch) | |
| tree | cca15628b4649f6d404990ffc1531ac5aeee0225 /py/emitglue.h | |
| parent | 36cbd0db7e4f297c8fc729c842b171af2cfd04c7 (diff) | |
py: Implement keyword-only args.
Implements 'def f(*, a)' and 'def f(*a, b)', but not default
keyword-only args, eg 'def f(*, a=1)'.
Partially addresses issue #524.
Diffstat (limited to 'py/emitglue.h')
| -rw-r--r-- | py/emitglue.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/py/emitglue.h b/py/emitglue.h index 9aea2e4d4..f15e5b716 100644 --- a/py/emitglue.h +++ b/py/emitglue.h @@ -9,9 +9,11 @@ typedef enum { } mp_raw_code_kind_t; typedef struct _mp_code_t { - mp_raw_code_kind_t kind : 8; - uint scope_flags : 8; - uint n_args : 16; + mp_raw_code_kind_t kind : 3; + uint scope_flags : 7; + uint n_pos_args : 11; + uint n_kwonly_args : 11; + qstr *arg_names; union { struct { byte *code; @@ -24,7 +26,6 @@ typedef struct _mp_code_t { void *fun; } u_inline_asm; }; - qstr *arg_names; } mp_raw_code_t; void mp_emit_glue_init(void); @@ -32,7 +33,7 @@ void mp_emit_glue_deinit(void); mp_raw_code_t *mp_emit_glue_new_raw_code(void); -void mp_emit_glue_assign_byte_code(mp_raw_code_t *rc, byte *code, uint len, int n_args, int n_locals, uint scope_flags, qstr *arg_names); +void mp_emit_glue_assign_byte_code(mp_raw_code_t *rc, byte *code, uint len, uint n_pos_args, uint n_kwonly_args, qstr *arg_names, uint scope_flags); void mp_emit_glue_assign_native_code(mp_raw_code_t *rc, void *f, uint len, int n_args); void mp_emit_glue_assign_inline_asm_code(mp_raw_code_t *rc, void *f, uint len, int n_args); |
