AST test is passing

This commit is contained in:
2026-04-07 20:06:31 +10:00
parent 522fc3e64b
commit 48072f0dd1
3 changed files with 490 additions and 5 deletions

View File

@@ -185,9 +185,9 @@ typedef struct Toy_AstPrint {
typedef struct Toy_AstVarDeclare {
Toy_AstType type;
Toy_String* name;
Toy_Ast* expr;
Toy_ValueType valueType;
bool constant;
Toy_Ast* expr;
} Toy_AstVarDeclare;
typedef struct Toy_AstVarAssign {

View File

@@ -795,7 +795,7 @@ static unsigned int writeInstructionVarDeclare(Toy_Bytecode** mb, Toy_AstVarDecl
static unsigned int writeInstructionAssign(Toy_Bytecode** mb, Toy_AstVarAssign ast, bool chainedAssignment) {
unsigned int result = 0;
//target is a name string
//target is a variable name
if (ast.target->type == TOY_AST_VALUE && TOY_VALUE_IS_STRING(ast.target->value.value)) {
//name string
Toy_String* target = TOY_VALUE_AS_STRING(ast.target->value.value);