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,14 @@
@type [compiler]
@source
do
{}
while none;
@bytecode
begin:
PUSHNNE;
JUMPIFANDPOP begin;
EXIT;
@@ -0,0 +1,19 @@
@type [compiler]
@source
do
true;
while none;
false;
@bytecode
begin:
PUSHTRU;
POP 1;
PUSHNNE;
JUMPIFANDPOP begin;
PUSHFLS;
POP 1;
EXIT;
@@ -0,0 +1,22 @@
@type [compiler]
@source
do {
true;
"Hello, world!";
} while none;
false;
@bytecode
begin:
PUSHTRU;
POP 1;
PUSHSTR "Hello, world!";
POP 1;
PUSHNNE;
JUMPIFANDPOP begin;
PUSHFLS;
POP 1;
EXIT;
@@ -0,0 +1,25 @@
@type [compiler]
@source
do {
true;
"Hello, world!";
break;
} while none;
false;
@bytecode
begin:
PUSHTRU;
POP 1;
PUSHSTR "Hello, world!";
POP 1;
JUMP end;
PUSHNNE;
JUMPIFANDPOP begin;
end:
PUSHFLS;
POP 1;
EXIT;
@@ -0,0 +1,19 @@
@type [compiler]
@source
do
break;
while none;
false;
@bytecode
begin:
JUMP end;
PUSHNNE;
JUMPIFANDPOP begin;
end:
PUSHFLS;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 + 7;
@bytecode
PUSHINT 1;
PUSHINT 7;
ADD;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 - 7;
@bytecode
PUSHINT 1;
PUSHINT 7;
SUB;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 * 7;
@bytecode
PUSHINT 1;
PUSHINT 7;
MUL;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 / 7;
@bytecode
PUSHINT 1;
PUSHINT 7;
DIV;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1.0 + 7;
@bytecode
PUSHFLT 1.0;
PUSHINT 7;
ADD;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1.0 - 7;
@bytecode
PUSHFLT 1.0;
PUSHINT 7;
SUB;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1.0 * 7;
@bytecode
PUSHFLT 1.0;
PUSHINT 7;
MUL;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1.0 / 7;
@bytecode
PUSHFLT 1.0;
PUSHINT 7;
DIV;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 + 7.0;
@bytecode
PUSHINT 1;
PUSHFLT 7.0;
ADD;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 - 7.0;
@bytecode
PUSHINT 1;
PUSHFLT 7.0;
SUB;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 * 7.0;
@bytecode
PUSHINT 1;
PUSHFLT 7.0;
MUL;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 / 7.0;
@bytecode
PUSHINT 1;
PUSHFLT 7.0;
DIV;
POP 1;
EXIT;
@@ -0,0 +1,17 @@
@type [compiler]
@source
1 + 2 * 3;
@bytecode
PUSHINT 1;
PUSHINT 2;
PUSHINT 3;
MUL;
ADD;
POP 1;
EXIT;
@@ -0,0 +1,17 @@
@type [compiler]
@source
1 * 2 + 3;
@bytecode
PUSHINT 1;
PUSHINT 2;
MUL;
PUSHINT 3;
ADD;
POP 1;
EXIT;
@@ -0,0 +1,17 @@
@type [compiler]
@source
(1 + 2) * 3;
@bytecode
PUSHINT 1;
PUSHINT 2;
ADD;
PUSHINT 3;
MUL;
POP 1;
EXIT;
@@ -0,0 +1,15 @@
@type [compiler]
@source
1 + (2 * 3);
@bytecode
PUSHINT 1;
PUSHINT 2;
PUSHINT 3;
MUL;
ADD;
POP 1;
EXIT;
@@ -0,0 +1,20 @@
@type [compiler]
@source
1 * 2 * 3 * 4;
@bytecode
PUSHINT 1;
PUSHINT 2;
MUL;
PUSHINT 3;
MUL;
PUSHINT 4;
MUL;
POP 1;
EXIT;
@@ -0,0 +1,17 @@
@type [compiler]
@source
1 * (2 * (3 * 4));
@bytecode
PUSHINT 1;
PUSHINT 2;
PUSHINT 3;
PUSHINT 4;
MUL;
MUL;
MUL;
POP 1;
EXIT;
@@ -0,0 +1,17 @@
@type [compiler]
@source
1 + 2 * 3 + 4;
@bytecode
PUSHINT 1;
PUSHINT 2;
PUSHINT 3;
MUL;
ADD;
PUSHINT 4;
ADD;
POP 1;
EXIT;
@@ -0,0 +1,20 @@
@type [compiler]
@source
1 * 2 + 3 * 4;
@bytecode
PUSHINT 1;
PUSHINT 2;
MUL;
PUSHINT 3;
PUSHINT 4;
MUL;
ADD;
POP 1;
EXIT;
@@ -0,0 +1,24 @@
@type [compiler]
@source
A - B - C;
A - B * C;
@bytecode
PUSHVAR "A";
PUSHVAR "B";
SUB;
PUSHVAR "C";
SUB;
POP 1;
PUSHVAR "A";
PUSHVAR "B";
PUSHVAR "C";
MUL;
SUB;
POP 1;
EXIT;
@@ -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;
@@ -0,0 +1,22 @@
@type [compiler]
@source
# This comment is because there
# can't be a '[' right before a
# tag.
[true, false];
@bytecode
PUSHLST 2;
PUSHINT 0;
PUSHTRU;
INSERT;
PUSHINT 1;
PUSHFLS;
INSERT;
POP 1;
EXIT;
@@ -0,0 +1,12 @@
@type [compiler]
@source
var = none;
@bytecode
PUSHNNE;
ASS "var";
POP 1;
EXIT;
@@ -0,0 +1,14 @@
@type [compiler]
@source
var[key] = none;
@bytecode
PUSHNNE;
PUSHVAR "var";
PUSHVAR "key";
INSERT2;
POP 1;
EXIT;
@@ -0,0 +1,18 @@
@type [compiler]
@source
A, B = func();
@bytecode
PUSHVAR "func";
CALL 0, 2;
ASS "B";
POP 1;
ASS "A";
POP 1;
EXIT;
@@ -0,0 +1,14 @@
@type [compiler]
@source
var.key = none;
@bytecode
PUSHNNE;
PUSHVAR "var";
PUSHSTR "key";
INSERT2;
POP 1;
EXIT;
@@ -0,0 +1,19 @@
@type [compiler]
@source
1 and 2;
@bytecode
PUSHINT 1;
JUMPIFNOTANDPOP false;
PUSHINT 2;
JUMPIFNOTANDPOP false;
PUSHTRU;
JUMP end;
false:
PUSHFLS;
end:
POP 1;
EXIT;
@@ -0,0 +1,19 @@
@type [compiler]
@source
1 or 2;
@bytecode
PUSHINT 1;
JUMPIFANDPOP true;
PUSHINT 2;
JUMPIFANDPOP true;
PUSHFLS;
JUMP end;
true:
PUSHTRU;
end:
POP 1;
EXIT;
@@ -0,0 +1,35 @@
@type [compiler]
@source
A and B or C and D;
@bytecode
PUSHVAR "A";
JUMPIFNOTANDPOP false_0;
PUSHVAR "B";
JUMPIFNOTANDPOP false_0;
PUSHTRU;
JUMP end_0;
false_0:
PUSHFLS;
end_0:
JUMPIFANDPOP true_2;
PUSHVAR "C";
JUMPIFNOTANDPOP false_1;
PUSHVAR "D";
JUMPIFNOTANDPOP false_1;
PUSHTRU;
JUMP end_1;
false_1:
PUSHFLS;
end_1:
JUMPIFANDPOP true_2;
PUSHFLS;
JUMP end_2;
true_2:
PUSHTRU;
end_2:
POP 1;
EXIT;
@@ -0,0 +1,35 @@
@type [compiler]
@source
X or Y and Z or W;
@bytecode
PUSHVAR "X";
JUMPIFANDPOP true_0;
PUSHVAR "Y";
JUMPIFNOTANDPOP false_1;
PUSHVAR "Z";
JUMPIFNOTANDPOP false_1;
PUSHTRU;
JUMP end_1;
false_1:
PUSHFLS;
end_1:
JUMPIFANDPOP true_0;
PUSHFLS;
JUMP end_0;
true_0:
PUSHTRU;
end_0:
JUMPIFANDPOP true_2;
PUSHVAR "W";
JUMPIFANDPOP true_2;
PUSHFLS;
JUMP end_2;
true_2:
PUSHTRU;
end_2:
POP 1;
EXIT;
@@ -0,0 +1,14 @@
@type [compiler]
@source
({'name': 'Francesco'});
@bytecode
PUSHMAP 1;
PUSHSTR "name";
PUSHSTR "Francesco";
INSERT;
POP 1;
EXIT;
@@ -0,0 +1,20 @@
@type [compiler]
@source
({'name': 'Francesco', 'age': 25});
@bytecode
PUSHMAP 2;
PUSHSTR "name";
PUSHSTR "Francesco";
INSERT;
PUSHSTR "age";
PUSHINT 25;
INSERT;
POP 1;
EXIT;
@@ -0,0 +1,14 @@
@type [compiler]
@source
({name: 'Francesco'});
@bytecode
PUSHMAP 1;
PUSHSTR "name";
PUSHSTR "Francesco";
INSERT;
POP 1;
EXIT;
@@ -0,0 +1,20 @@
@type [compiler]
@source
({name: 'Francesco', age: 25});
@bytecode
PUSHMAP 2;
PUSHSTR "name";
PUSHSTR "Francesco";
INSERT;
PUSHSTR "age";
PUSHINT 25;
INSERT;
POP 1;
EXIT;
@@ -0,0 +1,15 @@
@type [compiler]
@source
({+name: 'Francesco'});
@bytecode
PUSHMAP 1;
PUSHVAR "name";
POS;
PUSHSTR "Francesco";
INSERT;
POP 1;
EXIT;
@@ -0,0 +1,15 @@
@type [compiler]
@source
({+name: 'Francesco'});
@bytecode
PUSHMAP 1;
PUSHVAR "name";
POS;
PUSHSTR "Francesco";
INSERT;
POP 1;
EXIT;
@@ -0,0 +1,12 @@
@type [compiler]
@source
func();
@bytecode
PUSHVAR "func";
CALL 0, 1;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
func(none);
@bytecode
PUSHNNE;
PUSHVAR "func";
CALL 1, 1;
POP 1;
EXIT;
@@ -0,0 +1,14 @@
@type [compiler]
@source
func(true, false);
@bytecode
PUSHFLS;
PUSHTRU;
PUSHVAR "func";
CALL 2, 1;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
set[key];
@bytecode
PUSHVAR "set";
PUSHVAR "key";
SELECT;
POP 1;
EXIT;
@@ -0,0 +1,26 @@
@type [compiler]
@source
set["dog", "cow", "cat"];
@bytecode
PUSHVAR "set";
PUSHLST 3;
PUSHINT 0;
PUSHSTR "dog";
INSERT;
PUSHINT 1;
PUSHSTR "cow";
INSERT;
PUSHINT 2;
PUSHSTR "cat";
INSERT;
SELECT;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
set.key;
@bytecode
PUSHVAR "set";
PUSHSTR "key";
SELECT;
POP 1;
EXIT;
@@ -0,0 +1,12 @@
@type [compiler]
@source
-1;
@bytecode
PUSHINT 1;
NEG;
POP 1;
EXIT;
@@ -0,0 +1,12 @@
@type [compiler]
@source
+1;
@bytecode
PUSHINT 1;
POS;
POP 1;
EXIT;
@@ -0,0 +1,12 @@
@type [compiler]
@source
not 1;
@bytecode
PUSHINT 1;
NOT;
POP 1;
EXIT;
@@ -0,0 +1,9 @@
@type [compiler]
@source
1;
@bytecode
PUSHINT 1;
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
6.7;
@bytecode
PUSHFLT 6.7;
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
'Hello, world!';
@bytecode
PUSHSTR "Hello, world!";
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
true;
@bytecode
PUSHTRU;
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
false;
@bytecode
PUSHFLS;
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
none;
@bytecode
PUSHNNE;
POP 1;
EXIT;
@@ -0,0 +1,11 @@
@type [compiler]
@source
({});
@bytecode
PUSHMAP 0;
POP 1;
EXIT;
@@ -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;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 == 2;
@bytecode
PUSHINT 1;
PUSHINT 2;
EQL;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 != 2;
@bytecode
PUSHINT 1;
PUSHINT 2;
NQL;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 < 2;
@bytecode
PUSHINT 1;
PUSHINT 2;
LSS;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 > 2;
@bytecode
PUSHINT 1;
PUSHINT 2;
GRT;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 <= 2;
@bytecode
PUSHINT 1;
PUSHINT 2;
LEQ;
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
1 >= 2;
@bytecode
PUSHINT 1;
PUSHINT 2;
GEQ;
POP 1;
EXIT;
@@ -0,0 +1,47 @@
@type [compiler]
@source
1 + 2 > 3 + 4;
1 + 2 < 3 + 4;
1 + 2 >= 3 + 4;
1 + 2 <= 3 + 4;
@bytecode
PUSHINT 1;
PUSHINT 2;
ADD;
PUSHINT 3;
PUSHINT 4;
ADD;
GRT;
POP 1;
PUSHINT 1;
PUSHINT 2;
ADD;
PUSHINT 3;
PUSHINT 4;
ADD;
LSS;
POP 1;
PUSHINT 1;
PUSHINT 2;
ADD;
PUSHINT 3;
PUSHINT 4;
ADD;
GEQ;
POP 1;
PUSHINT 1;
PUSHINT 2;
ADD;
PUSHINT 3;
PUSHINT 4;
ADD;
LEQ;
POP 1;
EXIT;
@@ -0,0 +1,16 @@
@type [compiler]
@source
fun X() {}
@bytecode
PUSHFUN fun, 0, "X";
JUMP end;
fun:
RETURN 0;
end:
ASS "X";
POP 1;
EXIT;
@@ -0,0 +1,18 @@
@type [compiler]
@source
fun X() "Hello, world!";
@bytecode
PUSHFUN fun, 0, "X";
JUMP end;
fun:
PUSHSTR "Hello, world!";
POP 1;
RETURN 0;
end:
ASS "X";
POP 1;
EXIT;
@@ -0,0 +1,23 @@
@type [compiler]
@source
fun X() {
"Hello, world!";
return false;
}
@bytecode
PUSHFUN fun, 0, "X";
JUMP end;
fun:
PUSHSTR "Hello, world!";
POP 1;
PUSHFLS;
RETURN 1;
RETURN 0;
end:
ASS "X";
POP 1;
EXIT;
@@ -0,0 +1,22 @@
@type [compiler]
@source
fun nop(a) {
return a;
}
@bytecode
PUSHFUN fun, 1, "nop";
JUMP end;
fun:
ASS "a";
POP 1;
PUSHVAR "a";
RETURN 1;
RETURN 0;
end:
ASS "nop";
POP 1;
EXIT;
@@ -0,0 +1,26 @@
@type [compiler]
@source
fun add(a, b) {
return a + b;
}
@bytecode
PUSHFUN fun, 2, "add";
JUMP end;
fun:
ASS "b";
POP 1;
ASS "a";
POP 1;
PUSHVAR "a";
PUSHVAR "b";
ADD;
RETURN 1;
RETURN 0;
end:
ASS "add";
POP 1;
EXIT;
@@ -0,0 +1,24 @@
@type [compiler]
@source
fun nop(a: None) {
return a;
}
@bytecode
PUSHFUN fun, 1, "nop";
JUMP end;
fun:
PUSHVAR "None";
CHECKTYPE 0, "a";
ASS "a";
POP 1;
PUSHVAR "a";
RETURN 1;
RETURN 0;
end:
ASS "nop";
POP 1;
EXIT;
@@ -0,0 +1,28 @@
@type [compiler]
@source
fun add(a: int, b) {
return a + b;
}
@bytecode
PUSHFUN fun, 2, "add";
JUMP end;
fun:
ASS "b";
POP 1;
PUSHVAR "int";
CHECKTYPE 0, "a";
ASS "a";
POP 1;
PUSHVAR "a";
PUSHVAR "b";
ADD;
RETURN 1;
RETURN 0;
end:
ASS "add";
POP 1;
EXIT;
@@ -0,0 +1,28 @@
@type [compiler]
@source
fun add(a, b: int) {
return a + b;
}
@bytecode
PUSHFUN fun, 2, "add";
JUMP end;
fun:
PUSHVAR "int";
CHECKTYPE 1, "b";
ASS "b";
POP 1;
ASS "a";
POP 1;
PUSHVAR "a";
PUSHVAR "b";
ADD;
RETURN 1;
RETURN 0;
end:
ASS "add";
POP 1;
EXIT;
@@ -0,0 +1,30 @@
@type [compiler]
@source
fun add(a: int, b: int) {
return a + b;
}
@bytecode
PUSHFUN fun, 2, "add";
JUMP end;
fun:
PUSHVAR "int";
CHECKTYPE 1, "b";
ASS "b";
POP 1;
PUSHVAR "int";
CHECKTYPE 0, "a";
ASS "a";
POP 1;
PUSHVAR "a";
PUSHVAR "b";
ADD;
RETURN 1;
RETURN 0;
end:
ASS "add";
POP 1;
EXIT;
@@ -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;
@@ -0,0 +1,26 @@
@type [compiler]
@source
fun nop(a = 1)
{}
@bytecode
PUSHFUN nop, 1, "nop";
JUMP nop_end;
nop:
PUSHTYP;
PUSHNNETYP;
EQL;
JUMPIFNOTANDPOP not_none;
POP 1;
PUSHINT 1;
not_none:
ASS "a";
POP 1;
RETURN 0;
nop_end:
ASS "nop";
POP 1;
EXIT;
@@ -0,0 +1,28 @@
@type [compiler]
@source
fun nop(a = 1, b)
{}
@bytecode
PUSHFUN nop, 2, "nop";
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:
ASS "nop";
POP 1;
EXIT;
@@ -0,0 +1,28 @@
@type [compiler]
@source
fun nop(a, b = true)
{}
@bytecode
PUSHFUN nop, 2, "nop";
JUMP nop_end;
nop:
PUSHTYP;
PUSHNNETYP;
EQL;
JUMPIFNOTANDPOP not_none;
POP 1;
PUSHTRU;
not_none:
ASS "b";
POP 1;
ASS "a";
POP 1;
RETURN 0;
nop_end:
ASS "nop";
POP 1;
EXIT;
@@ -0,0 +1,28 @@
@type [compiler]
@source
fun nop(a: int = 1)
{}
@bytecode
PUSHFUN nop, 1, "nop";
JUMP nop_end;
nop:
PUSHTYP;
PUSHNNETYP;
EQL;
JUMPIFNOTANDPOP not_none;
POP 1;
PUSHINT 1;
not_none:
PUSHVAR "int";
CHECKTYPE 0, "a";
ASS "a";
POP 1;
RETURN 0;
nop_end:
ASS "nop";
POP 1;
EXIT;
@@ -0,0 +1,13 @@
@type [compiler]
@source
if true:
{}
@bytecode
PUSHTRU;
JUMPIFNOTANDPOP end;
end:
EXIT;
@@ -0,0 +1,15 @@
@type [compiler]
@source
if true:
none;
@bytecode
PUSHTRU;
JUMPIFNOTANDPOP end;
PUSHNNE;
POP 1;
end:
EXIT;
@@ -0,0 +1,18 @@
@type [compiler]
@source
if true:
{}
else
{}
@bytecode
PUSHTRU;
JUMPIFNOTANDPOP end;
JUMP end;
end:
EXIT;
@@ -0,0 +1,21 @@
@type [compiler]
@source
if none:
true;
else
false;
@bytecode
PUSHNNE;
JUMPIFNOTANDPOP else;
PUSHTRU;
POP 1;
JUMP end;
else:
PUSHFLS;
POP 1;
end:
EXIT;
@@ -0,0 +1,7 @@
@type [compiler]
@source
# (Empty source)
@bytecode
EXIT;
@@ -0,0 +1,9 @@
@type [compiler]
@source
return none;
@bytecode
PUSHNNE;
RETURN 1;
EXIT;
@@ -0,0 +1,15 @@
@type [compiler]
@source
while none:
{}
@bytecode
begin:
PUSHNNE;
JUMPIFNOTANDPOP end;
JUMP begin;
end:
EXIT;
@@ -0,0 +1,20 @@
@type [compiler]
@source
while none:
true;
false;
@bytecode
begin:
PUSHNNE;
JUMPIFNOTANDPOP end;
PUSHTRU;
POP 1;
JUMP begin;
end:
PUSHFLS;
POP 1;
EXIT;
@@ -0,0 +1,24 @@
@type [compiler]
@source
while none: {
true;
"Hello, world!";
}
false;
@bytecode
begin:
PUSHNNE;
JUMPIFNOTANDPOP end;
PUSHTRU;
POP 1;
PUSHSTR "Hello, world!";
POP 1;
JUMP begin;
end:
PUSHFLS;
POP 1;
EXIT;
@@ -0,0 +1,26 @@
@type [compiler]
@source
while none: {
true;
"Hello, world!";
break;
}
false;
@bytecode
begin:
PUSHNNE;
JUMPIFNOTANDPOP end;
PUSHTRU;
POP 1;
PUSHSTR "Hello, world!";
POP 1;
JUMP end;
JUMP begin;
end:
PUSHFLS;
POP 1;
EXIT;
@@ -0,0 +1,19 @@
@type [compiler]
@source
while none:
break;
false;
@bytecode
begin:
PUSHNNE;
JUMPIFNOTANDPOP end;
JUMP end;
JUMP begin;
end:
PUSHFLS;
POP 1;
EXIT;