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
@@ -1,11 +1,12 @@
#source
@type [compiler]
@source
do
{}
while none;
#bytecode
@bytecode
begin:
PUSHNNE;
@@ -1,12 +1,13 @@
#source
@type [compiler]
@source
do
true;
while none;
false;
#bytecode
@bytecode
begin:
PUSHTRU;
@@ -1,5 +1,6 @@
#source
@type [compiler]
@source
do {
true;
@@ -7,7 +8,7 @@
} while none;
false;
#bytecode
@bytecode
begin:
PUSHTRU;
@@ -1,5 +1,6 @@
#source
@type [compiler]
@source
do {
true;
@@ -8,7 +9,7 @@
} while none;
false;
#bytecode
@bytecode
begin:
PUSHTRU;
@@ -1,12 +1,13 @@
#source
@type [compiler]
@source
do
break;
while none;
false;
#bytecode
@bytecode
begin:
JUMP end;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 + 7;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 7;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 - 7;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 7;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 * 7;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 7;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 / 7;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 7;
@@ -1,12 +1,13 @@
#source
@type [compiler]
@source
1.0 + 7;
#bytecode
@bytecode
PUSHFLT 1.0;
PUSHINT 7;
ADD;
POP 1;
EXIT;
EXIT;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1.0 - 7;
#bytecode
@bytecode
PUSHFLT 1.0;
PUSHINT 7;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1.0 * 7;
#bytecode
@bytecode
PUSHFLT 1.0;
PUSHINT 7;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1.0 / 7;
#bytecode
@bytecode
PUSHFLT 1.0;
PUSHINT 7;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 + 7.0;
#bytecode
@bytecode
PUSHINT 1;
PUSHFLT 7.0;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 - 7.0;
#bytecode
@bytecode
PUSHINT 1;
PUSHFLT 7.0;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 * 7.0;
#bytecode
@bytecode
PUSHINT 1;
PUSHFLT 7.0;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 / 7.0;
#bytecode
@bytecode
PUSHINT 1;
PUSHFLT 7.0;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 + 2 * 3;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 * 2 + 3;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
(1 + 2) * 3;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 + (2 * 3);
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 * 2 * 3 * 4;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 * (2 * (3 * 4));
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 + 2 * 3 + 4;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 * 2 + 3 * 4;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,10 +1,11 @@
#source
@type [compiler]
@source
A - B - C;
A - B * C;
#bytecode
@bytecode
PUSHVAR "A";
PUSHVAR "B";
@@ -0,0 +1,16 @@
@type [compiler]
@source
# This comment is because there
# can't be a '[' right before a
# tag.
[1];
@bytecode
PUSHLST 1;
PUSHINT 0;
PUSHINT 1;
INSERT;
POP 1;
EXIT;
@@ -1,9 +1,12 @@
#source
@type [compiler]
@source
# This comment is because there
# can't be a '[' right before a
# tag.
[true, false];
#bytecode
@bytecode
PUSHLST 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
var = none;
#bytecode
@bytecode
PUSHNNE;
ASS "var";
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
var[key] = none;
#bytecode
@bytecode
PUSHNNE;
PUSHVAR "var";
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
A, B = func();
#bytecode
@bytecode
PUSHVAR "func";
CALL 0, 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
var.key = none;
#bytecode
@bytecode
PUSHNNE;
PUSHVAR "var";
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 and 2;
#bytecode
@bytecode
PUSHINT 1;
JUMPIFNOTANDPOP false;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 or 2;
#bytecode
@bytecode
PUSHINT 1;
JUMPIFANDPOP true;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
A and B or C and D;
#bytecode
@bytecode
PUSHVAR "A";
JUMPIFNOTANDPOP false_0;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
X or Y and Z or W;
#bytecode
@bytecode
PUSHVAR "X";
JUMPIFANDPOP true_0;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
({'name': 'Francesco'});
#bytecode
@bytecode
PUSHMAP 1;
PUSHSTR "name";
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
({'name': 'Francesco', 'age': 25});
#bytecode
@bytecode
PUSHMAP 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
({name: 'Francesco'});
#bytecode
@bytecode
PUSHMAP 1;
PUSHSTR "name";
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
({name: 'Francesco', age: 25});
#bytecode
@bytecode
PUSHMAP 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
({+name: 'Francesco'});
#bytecode
@bytecode
PUSHMAP 1;
PUSHVAR "name";
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
({+name: 'Francesco'});
#bytecode
@bytecode
PUSHMAP 1;
PUSHVAR "name";
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
func();
#bytecode
@bytecode
PUSHVAR "func";
CALL 0, 1;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
func(none);
#bytecode
@bytecode
PUSHNNE;
PUSHVAR "func";
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
func(true, false);
#bytecode
@bytecode
PUSHFLS;
PUSHTRU;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
set[key];
#bytecode
@bytecode
PUSHVAR "set";
PUSHVAR "key";
@@ -1,8 +1,9 @@
#source
@type [compiler]
@source
set["dog", "cow", "cat"];
#bytecode
@bytecode
PUSHVAR "set";
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
set.key;
#bytecode
@bytecode
PUSHVAR "set";
PUSHSTR "key";
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
-1;
#bytecode
@bytecode
PUSHINT 1;
NEG;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
+1;
#bytecode
@bytecode
PUSHINT 1;
POS;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
not 1;
#bytecode
@bytecode
PUSHINT 1;
NOT;
@@ -0,0 +1,9 @@
@type [compiler]
@source
1;
@bytecode
PUSHINT 1;
POP 1;
EXIT;
@@ -1,9 +1,10 @@
@type [compiler]
#source
@source
6.7;
#bytecode
@bytecode
PUSHFLT 6.7;
POP 1;
@@ -1,9 +1,10 @@
@type [compiler]
#source
@source
'Hello, world!';
#bytecode
@bytecode
PUSHSTR "Hello, world!";
POP 1;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
true;
#bytecode
@bytecode
PUSHTRU;
POP 1;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
false;
#bytecode
@bytecode
PUSHFLS;
POP 1;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
none;
#bytecode
@bytecode
PUSHNNE;
POP 1;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
({});
#bytecode
@bytecode
PUSHMAP 0;
POP 1;
@@ -0,0 +1,14 @@
@type [compiler]
@source
# This comment is because there
# can't be a '[' right before a
# tag.
[];
@bytecode
PUSHLST 0;
POP 1;
EXIT;
@@ -0,0 +1,9 @@
@type [compiler]
@source
{}
@bytecode
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
'This \\ is a slash!';
@bytecode
PUSHSTR "This \\ is a slash!";
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
'This \n is a newline!';
@bytecode
PUSHSTR "This \n is a newline!";
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
'This \t is an horizontal tab!';
@bytecode
PUSHSTR "This \t is an horizontal tab!";
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
'This \r is a special character!';
@bytecode
PUSHSTR "This \r is a special character!";
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
'Look at this \'!';
@bytecode
PUSHSTR "Look at this '!";
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
"Look at this \"!";
@bytecode
PUSHSTR "Look at this \"!";
POP 1;
EXIT;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 == 2;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 != 2;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 < 2;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 > 2;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 <= 2;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,9 +1,10 @@
#source
@type [compiler]
@source
1 >= 2;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,12 +1,13 @@
#source
@type [compiler]
@source
1 + 2 > 3 + 4;
1 + 2 < 3 + 4;
1 + 2 >= 3 + 4;
1 + 2 <= 3 + 4;
#bytecode
@bytecode
PUSHINT 1;
PUSHINT 2;
@@ -1,11 +1,12 @@
#source
@type [compiler]
@source
fun X() {}
#bytecode
@bytecode
PUSHFUN fun, 0;
PUSHFUN fun, 0, "X";
JUMP end;
fun:
RETURN 0;
@@ -1,11 +1,12 @@
#source
@type [compiler]
@source
fun X() "Hello, world!";
#bytecode
@bytecode
PUSHFUN fun, 0;
PUSHFUN fun, 0, "X";
JUMP end;
fun:
PUSHSTR "Hello, world!";
@@ -1,14 +1,15 @@
#source
@type [compiler]
@source
fun X() {
"Hello, world!";
return false;
}
#bytecode
@bytecode
PUSHFUN fun, 0;
PUSHFUN fun, 0, "X";
JUMP end;
fun:
PUSHSTR "Hello, world!";
@@ -1,13 +1,14 @@
#source
@type [compiler]
@source
fun nop(a) {
return a;
}
#bytecode
@bytecode
PUSHFUN fun, 1;
PUSHFUN fun, 1, "nop";
JUMP end;
fun:
ASS "a";
@@ -1,13 +1,14 @@
#source
@type [compiler]
@source
fun add(a, b) {
return a + b;
}
#bytecode
@bytecode
PUSHFUN fun, 2;
PUSHFUN fun, 2, "add";
JUMP end;
fun:
ASS "b";
@@ -1,13 +1,14 @@
#source
@type [compiler]
@source
fun nop(a: None) {
return a;
}
#bytecode
@bytecode
PUSHFUN fun, 1;
PUSHFUN fun, 1, "nop";
JUMP end;
fun:
PUSHVAR "None";
@@ -1,13 +1,14 @@
#source
@type [compiler]
@source
fun add(a: int, b) {
return a + b;
}
#bytecode
@bytecode
PUSHFUN fun, 2;
PUSHFUN fun, 2, "add";
JUMP end;
fun:
ASS "b";
@@ -1,13 +1,14 @@
#source
@type [compiler]
@source
fun add(a, b: int) {
return a + b;
}
#bytecode
@bytecode
PUSHFUN fun, 2;
PUSHFUN fun, 2, "add";
JUMP end;
fun:
PUSHVAR "int";
@@ -1,13 +1,14 @@
#source
@type [compiler]
@source
fun add(a: int, b: int) {
return a + b;
}
#bytecode
@bytecode
PUSHFUN fun, 2;
PUSHFUN fun, 2, "add";
JUMP end;
fun:
PUSHVAR "int";
@@ -1,13 +1,14 @@
#source
@type [compiler]
@source
fun add(a: int | float, b: bool | Map) {
return a + b;
}
#bytecode
@bytecode
PUSHFUN fun, 2;
PUSHFUN fun, 2, "add";
JUMP end;
fun:
PUSHVAR "bool";
@@ -1,12 +1,13 @@
#source
@type [compiler]
@source
fun nop(a = 1)
{}
#bytecode
@bytecode
PUSHFUN nop, 1;
PUSHFUN nop, 1, "nop";
JUMP nop_end;
nop:
PUSHTYP;
@@ -1,12 +1,13 @@
#source
@type [compiler]
@source
fun nop(a = 1, b)
{}
#bytecode
@bytecode
PUSHFUN nop, 2;
PUSHFUN nop, 2, "nop";
JUMP nop_end;
nop:
ASS "b";
@@ -1,12 +1,13 @@
#source
@type [compiler]
@source
fun nop(a, b = true)
{}
#bytecode
@bytecode
PUSHFUN nop, 2;
PUSHFUN nop, 2, "nop";
JUMP nop_end;
nop:
PUSHTYP;
@@ -1,12 +1,13 @@
#source
@type [compiler]
@source
fun nop(a: int = 1)
{}
#bytecode
@bytecode
PUSHFUN nop, 1;
PUSHFUN nop, 1, "nop";
JUMP nop_end;
nop:
PUSHTYP;
@@ -1,10 +1,11 @@
#source
@type [compiler]
@source
if true:
{}
#bytecode
@bytecode
PUSHTRU;
JUMPIFNOTANDPOP end;
@@ -1,10 +1,11 @@
#source
@type [compiler]
@source
if true:
none;
#bytecode
@bytecode
PUSHTRU;
JUMPIFNOTANDPOP end;
@@ -1,12 +1,13 @@
#source
@type [compiler]
@source
if true:
{}
else
{}
#bytecode
@bytecode
PUSHTRU;
JUMPIFNOTANDPOP end;
@@ -1,12 +1,13 @@
#source
@type [compiler]
@source
if none:
true;
else
false;
#bytecode
@bytecode
PUSHNNE;
JUMPIFNOTANDPOP else;
@@ -0,0 +1,7 @@
@type [compiler]
@source
# (Empty source)
@bytecode
EXIT;
@@ -1,10 +1,9 @@
@type [compiler]
#source
@source
return none;
#bytecode
@bytecode
PUSHNNE;
RETURN 1;
EXIT;
@@ -1,10 +1,11 @@
#source
@type [compiler]
@source
while none:
{}
#bytecode
@bytecode
begin:
PUSHNNE;
@@ -1,11 +1,12 @@
#source
@type [compiler]
@source
while none:
true;
false;
#bytecode
@bytecode
begin:
PUSHNNE;
@@ -1,5 +1,6 @@
#source
@type [compiler]
@source
while none: {
true;
@@ -7,7 +8,7 @@
}
false;
#bytecode
@bytecode
begin:
PUSHNNE;
@@ -1,5 +1,6 @@
#source
@type [compiler]
@source
while none: {
true;
@@ -8,7 +9,7 @@
}
false;
#bytecode
@bytecode
begin:
PUSHNNE;
@@ -1,11 +1,12 @@
#source
@type [compiler]
@source
while none:
break;
false;
#bytecode
@bytecode
begin:
PUSHNNE;
+10
View File
@@ -0,0 +1,10 @@
@type [runtime]
@bytecode
PUSHNNE;
PUSHVAR "print";
CALL 1, 1;
POP 1;
EXIT;
@output [none]
+12
View File
@@ -0,0 +1,12 @@
@type [runtime]
@bytecode
PUSHTRU;
PUSHVAR "print";
CALL 1, 1;
POP 1;
EXIT;
@output [true]

Some files were not shown because too many files have changed in this diff Show More