Fix small bug and add todo
This commit is contained in:
@@ -7,13 +7,14 @@ using UnaryExpressionNode = Syntax.Parsing.Node.UnaryExpressionNode;
|
|||||||
|
|
||||||
namespace Syntax.Typing;
|
namespace Syntax.Typing;
|
||||||
|
|
||||||
|
// TODO: Currently anonymous function does not get a new scope
|
||||||
public static class Binder
|
public static class Binder
|
||||||
{
|
{
|
||||||
private static SyntaxTree _syntaxTree = null!;
|
private static SyntaxTree _syntaxTree = null!;
|
||||||
private static DefinitionTable _definitionTable = null!;
|
private static DefinitionTable _definitionTable = null!;
|
||||||
private static NubType? _funcReturnType = null;
|
|
||||||
|
|
||||||
private static Dictionary<string, NubType> _variables = new();
|
private static Dictionary<string, NubType> _variables = new();
|
||||||
|
private static NubType? _funcReturnType;
|
||||||
|
|
||||||
public static BoundSyntaxTree Bind(SyntaxTree syntaxTree, DefinitionTable definitionTable)
|
public static BoundSyntaxTree Bind(SyntaxTree syntaxTree, DefinitionTable definitionTable)
|
||||||
{
|
{
|
||||||
@@ -21,6 +22,7 @@ public static class Binder
|
|||||||
_definitionTable = definitionTable;
|
_definitionTable = definitionTable;
|
||||||
|
|
||||||
_variables = [];
|
_variables = [];
|
||||||
|
_funcReturnType = null;
|
||||||
|
|
||||||
var definitions = new List<BoundDefinitionNode>();
|
var definitions = new List<BoundDefinitionNode>();
|
||||||
|
|
||||||
@@ -269,7 +271,8 @@ public static class Binder
|
|||||||
|
|
||||||
private static BoundArrayInitializerNode BindArrayInitializer(ArrayInitializerNode expression)
|
private static BoundArrayInitializerNode BindArrayInitializer(ArrayInitializerNode expression)
|
||||||
{
|
{
|
||||||
return new BoundArrayInitializerNode(expression.Tokens, new NubArrayType(expression.ElementType), BindExpression(expression.Capacity, NubPrimitiveType.U64), expression.ElementType);
|
return new BoundArrayInitializerNode(expression.Tokens, new NubArrayType(expression.ElementType), BindExpression(expression.Capacity, NubPrimitiveType.U64),
|
||||||
|
expression.ElementType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BoundBinaryExpressionNode BindBinaryExpression(BinaryExpressionNode expression)
|
private static BoundBinaryExpressionNode BindBinaryExpression(BinaryExpressionNode expression)
|
||||||
|
|||||||
Reference in New Issue
Block a user