implemented default arguments

This commit is contained in:
cozis
2022-08-15 19:33:46 +02:00
parent 4a326bff7e
commit d9fd452b8b
11 changed files with 205 additions and 47 deletions
+27
View File
@@ -0,0 +1,27 @@
#source
fun nop(a = 1, b)
{}
#bytecode
PUSHFUN nop, 2;
ASS "nop";
POP 1;
JUMP nop_end;
nop:
ASS "b";
POP 1;
PUSHTYP;
PUSHNNETYP;
EQL;
JUMPIFNOTANDPOP not_none;
POP 1;
PUSHINT 1;
not_none:
ASS "a";
POP 1;
RETURN 0;
nop_end:
RETURN 0;