I fucking found it

This commit is contained in:
2022-08-30 04:51:28 +10:00
parent 1c6c7e5d4f
commit 14718a08d3
2 changed files with 1 additions and 13 deletions

View File

@@ -19,10 +19,6 @@ void initCompiler(Compiler* compiler) {
//separated out, so it can be recursive //separated out, so it can be recursive
static int writeLiteralTypeToCacheOpt(LiteralArray* literalCache, Literal literal, bool skipDuplicationOptimisation) { 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 it's a compound type, recurse and store the results
if (AS_TYPE(literal).typeOf == LITERAL_ARRAY || AS_TYPE(literal).typeOf == LITERAL_DICTIONARY) { 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 //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); int index = findLiteralIndex(literalCache, literal);
if (index < 0) { if (index < 0) {
index = pushLiteralArray(literalCache, literal); index = pushLiteralArray(literalCache, literal);
freeLiteral(literal);
} }
freeLiteral(literal);
return index; return index;
} }
else { else {

View File

@@ -1,15 +1,7 @@
var complex: type = type [string, [int]]; 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 ]]]; var deep: type = type [[[ int ]]];