mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Variables now persist between statements
This commit is contained in:
@@ -821,6 +821,10 @@ static void varDecl(Parser* parser, Node** nodeHandle) {
|
||||
if (match(parser, TOKEN_ASSIGN)) {
|
||||
expression(parser, &expressionNode);
|
||||
}
|
||||
else {
|
||||
//values are null by default
|
||||
emitNodeLiteral(&expressionNode, TO_NULL_LITERAL);
|
||||
}
|
||||
|
||||
//TODO: static type checking?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user