Fixed declarations without initial value

This commit is contained in:
2024-10-13 15:18:48 +11:00
parent 80734563b9
commit a51c5591ee
3 changed files with 51 additions and 2 deletions

View File

@@ -551,7 +551,7 @@ static void makeVariableDeclarationStmt(Toy_Bucket** bucketHandle, Toy_Parser* p
makeExpr(bucketHandle, parser, &expr);
}
else {
Toy_private_emitAstValue(bucketHandle, rootHandle, TOY_VALUE_FROM_NULL());
Toy_private_emitAstValue(bucketHandle, &expr, TOY_VALUE_FROM_NULL());
}
//finally, emit the declaration as an Ast