Add back variable assignment at declaration time
This commit is contained in:
@@ -189,7 +189,12 @@ public static class Binder
|
||||
private static BoundVariableDeclarationNode BindVariableDeclaration(VariableDeclarationNode statement)
|
||||
{
|
||||
_variables[statement.Name] = statement.Type;
|
||||
return new BoundVariableDeclarationNode(statement.Tokens, statement.Name, statement.Type);
|
||||
var assignment = Optional<BoundExpressionNode>.Empty();
|
||||
if (statement.Assignment.HasValue)
|
||||
{
|
||||
assignment = BindExpression(statement.Assignment.Value);
|
||||
}
|
||||
return new BoundVariableDeclarationNode(statement.Tokens, statement.Name, statement.Type, assignment);
|
||||
}
|
||||
|
||||
private static BoundWhileNode BindWhile(WhileNode statement)
|
||||
|
||||
Reference in New Issue
Block a user