new testing infrastructure

This commit is contained in:
Francesco Cozzuto
2023-01-22 02:22:44 +01:00
parent 533cf01920
commit 1780826a97
145 changed files with 1432 additions and 938 deletions
@@ -0,0 +1,34 @@
@type [compiler]
@source
fun add(a: int | float, b: bool | Map) {
return a + b;
}
@bytecode
PUSHFUN fun, 2, "add";
JUMP end;
fun:
PUSHVAR "bool";
PUSHVAR "Map";
STP;
CHECKTYPE 1, "b";
ASS "b";
POP 1;
PUSHVAR "int";
PUSHVAR "float";
STP;
CHECKTYPE 0, "a";
ASS "a";
POP 1;
PUSHVAR "a";
PUSHVAR "b";
ADD;
RETURN 1;
RETURN 0;
end:
ASS "add";
POP 1;
EXIT;