Fixed unary negation bug, removed newline from print

This commit is contained in:
2023-02-10 18:38:25 +00:00
parent 53012dbce1
commit aeb008c684
11 changed files with 96 additions and 25 deletions

View File

@@ -0,0 +1,7 @@
//This is just a check to ensure that unary minus doesn't screw up the AST
var xrel: int = 0;
var yrel: int = 0;
assert (xrel > 1 || xrel < -1 || yrel > 1 || yrel < -1) == false, "or-chaining bugfix failed";

View File

@@ -41,7 +41,7 @@ int main() {
//test answer
{
interpreter.printOutput("Testing answer");
interpreter.printOutput("Testing answer\n");
Toy_LiteralArray arguments;
Toy_initLiteralArray(&arguments);
@@ -69,7 +69,7 @@ int main() {
//test identity
{
interpreter.printOutput("Testing identity");
interpreter.printOutput("Testing identity\n");
Toy_LiteralArray arguments;
Toy_initLiteralArray(&arguments);
@@ -104,7 +104,7 @@ int main() {
//test makeCounter (closures)
{
interpreter.printOutput("Testing makeCounter (closures)");
interpreter.printOutput("Testing makeCounter (closures)\n");
Toy_LiteralArray arguments;
Toy_initLiteralArray(&arguments);
@@ -209,7 +209,7 @@ int main() {
//test assertion failure
{
interpreter.printOutput("Testing assertion failure");
interpreter.printOutput("Testing assertion failure\n");
Toy_setInterpreterAssert(&interpreter, noPrintFn);

View File

@@ -126,6 +126,7 @@ int main() {
"long-dictionary.toy",
"long-literals.toy",
"native-functions.toy",
"or-chaining-bugfix.toy",
"panic-within-functions.toy",
"ternary-expressions.toy",
"types.toy",