summaryrefslogtreecommitdiffstatshomepage
path: root/py/showbc.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-02-01 15:05:04 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-02-01 15:38:22 +0200
commit90750029df8d7fd24600cc4fe4c98a5b80731f28 (patch)
tree7e04bc8f0a079b79a7efcd634615ef3204f3f0ac /py/showbc.c
parent532f2c30f66c9ff1e4f2aded29b98ba0db5ec341 (diff)
downloadmicropython-90750029df8d7fd24600cc4fe4c98a5b80731f28.tar.gz
micropython-90750029df8d7fd24600cc4fe4c98a5b80731f28.zip
Implement default function arguments (for Python functions).
TODO: Decide if we really need separate bytecode for creating functions with default arguments - we would need same for closures, then there're keywords arguments too. Having all combinations is a small exponential explosion, likely we need just 2 cases - simplest (no defaults, no kw), and full - defaults & kw.
Diffstat (limited to 'py/showbc.c')
-rw-r--r--py/showbc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/showbc.c b/py/showbc.c
index 8a12302531..53a1826045 100644
--- a/py/showbc.c
+++ b/py/showbc.c
@@ -339,6 +339,11 @@ void mp_byte_code_print(const byte *ip, int len) {
printf("MAKE_FUNCTION " UINT_FMT, unum);
break;
+ case MP_BC_MAKE_FUNCTION_DEFARGS:
+ DECODE_UINT;
+ printf("MAKE_FUNCTION_DEFARGS " UINT_FMT, unum);
+ break;
+
case MP_BC_MAKE_CLOSURE:
DECODE_UINT;
printf("MAKE_CLOSURE " UINT_FMT, unum);