From 14718a08d35eb928b919d744873013f9bcf360f6 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Tue, 30 Aug 2022 04:51:28 +1000 Subject: [PATCH] I fucking found it --- source/compiler.c | 6 +----- test/sample_code.toy | 8 -------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/source/compiler.c b/source/compiler.c index 56d1865..4f19ad0 100644 --- a/source/compiler.c +++ b/source/compiler.c @@ -19,10 +19,6 @@ void initCompiler(Compiler* compiler) { //separated out, so it can be recursive static int writeLiteralTypeToCacheOpt(LiteralArray* literalCache, Literal literal, bool skipDuplicationOptimisation) { - printf(WARN); - printLiteral(literal); - printf(RESET); - //if it's a compound type, recurse and store the results if (AS_TYPE(literal).typeOf == LITERAL_ARRAY || AS_TYPE(literal).typeOf == LITERAL_DICTIONARY) { //I don't like storing types in an array, but it's the easiest and most straight forward method @@ -51,9 +47,9 @@ static int writeLiteralTypeToCacheOpt(LiteralArray* literalCache, Literal litera int index = findLiteralIndex(literalCache, literal); if (index < 0) { index = pushLiteralArray(literalCache, literal); - freeLiteral(literal); } + freeLiteral(literal); return index; } else { diff --git a/test/sample_code.toy b/test/sample_code.toy index c5b6211..1f18509 100644 --- a/test/sample_code.toy +++ b/test/sample_code.toy @@ -1,15 +1,7 @@ - var complex: type = type [string, [int]]; -var dict: complex = [ - "first array": [1, 2, 3], - "second array": [4, 5, 6], - "third array": [7, 8, 9] -]; - - var deep: type = type [[[ int ]]];