summaryrefslogtreecommitdiff
path: root/py/scope.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-27 15:50:52 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-27 15:50:52 +0100
commit2827d62e8b5790b2d770b9ce54e25cd56e949f20 (patch)
treecca15628b4649f6d404990ffc1531ac5aeee0225 /py/scope.h
parent36cbd0db7e4f297c8fc729c842b171af2cfd04c7 (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/scope.h')
-rw-r--r--py/scope.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/py/scope.h b/py/scope.h
index 6e0990ea9..7ef81b0c8 100644
--- a/py/scope.h
+++ b/py/scope.h
@@ -8,7 +8,8 @@ enum {
enum {
ID_FLAG_IS_PARAM = 0x01,
- ID_FLAG_IS_DELETED = 0x02,
+ ID_FLAG_IS_STAR_PARAM = 0x02,
+ ID_FLAG_IS_DBL_STAR_PARAM = 0x04,
};
typedef struct _id_info_t {
@@ -32,7 +33,8 @@ typedef struct _scope_t {
mp_raw_code_t *raw_code;
uint8_t scope_flags; // see runtime0.h
uint8_t emit_options; // see compile.h
- uint16_t num_params;
+ uint16_t num_pos_args;
+ uint16_t num_kwonly_args;
uint16_t num_locals;
uint16_t stack_size; // maximum size of the locals stack
uint16_t exc_stack_size; // maximum size of the exception stack