diff --git a/source/toy_compiler.c b/source/toy_compiler.c index 47893fd..9dce1b8 100644 --- a/source/toy_compiler.c +++ b/source/toy_compiler.c @@ -130,7 +130,7 @@ static int writeNodeCompoundToCache(Toy_Compiler* compiler, Toy_ASTNode* node) { } //push the store to the cache, with instructions about how pack it - Toy_Literal literal = TOY_TO_DICTIONARY_LITERAL(store); + Toy_Literal literal = TOY_TO_DICTIONARY_LITERAL((Toy_LiteralDictionary*)store); //cast from array to dict, because it's intermediate literal.type = TOY_LITERAL_DICTIONARY_INTERMEDIATE; //god damn it - nested in a dictionary index = Toy_pushLiteralArray(&compiler->literalCache, literal); Toy_freeLiteral(literal); diff --git a/source/toy_interpreter.c b/source/toy_interpreter.c index 67b1e14..826258c 100644 --- a/source/toy_interpreter.c +++ b/source/toy_interpreter.c @@ -1862,6 +1862,9 @@ static bool execIndexAssign(Toy_Interpreter* interpreter) { Toy_freeLiteral(op); Toy_freeLiteralArray(&arguments); + + //if we loop, then we need to be assigning + opStr = "="; } //BUGFIX: make sure the compound name can be assigned diff --git a/source/toy_literal.h b/source/toy_literal.h index 64df483..c617201 100644 --- a/source/toy_literal.h +++ b/source/toy_literal.h @@ -8,6 +8,7 @@ struct Toy_Literal; struct Toy_Interpreter; struct Toy_LiteralArray; +struct Toy_LiteralDictionary; struct Toy_Scope; typedef int (*Toy_NativeFn)(struct Toy_Interpreter* interpreter, struct Toy_LiteralArray* arguments); typedef int (*Toy_HookFn)(struct Toy_Interpreter* interpreter, struct Toy_Literal identifier, struct Toy_Literal alias); @@ -49,8 +50,8 @@ typedef struct Toy_Literal { //string hash? } string; //8 - void* array; //8 - void* dictionary; //8 + struct Toy_LiteralArray* array; //8 + struct Toy_LiteralDictionary* dictionary; //8 struct { union { @@ -67,7 +68,8 @@ typedef struct Toy_Literal { } identifier; //16 struct { - void* subtypes; //8 + + struct Toy_Literal* subtypes; //8 Toy_LiteralType typeOf; //4 unsigned char capacity; //1 unsigned char count; //1