Fix formatting
This commit is contained in:
@@ -391,22 +391,22 @@ public sealed class TypeChecker(string fileName, NodeDefinitionFunc function, Mo
|
||||
|
||||
public abstract class TypedNode(List<Token> tokens)
|
||||
{
|
||||
public readonly List<Token> Tokens = tokens;
|
||||
public List<Token> Tokens { get; } = tokens;
|
||||
}
|
||||
|
||||
public abstract class TypedNodeDefinition(List<Token> tokens) : TypedNode(tokens);
|
||||
|
||||
public sealed class TypedNodeDefinitionFunc(List<Token> tokens, TokenIdent name, List<TypedNodeDefinitionFunc.Param> parameters, TypedNodeStatement body, NubType returnType) : TypedNodeDefinition(tokens)
|
||||
{
|
||||
public readonly TokenIdent Name = name;
|
||||
public readonly List<Param> Parameters = parameters;
|
||||
public readonly TypedNodeStatement Body = body;
|
||||
public readonly NubType ReturnType = returnType;
|
||||
public TokenIdent Name { get; } = name;
|
||||
public List<Param> Parameters { get; } = parameters;
|
||||
public TypedNodeStatement Body { get; } = body;
|
||||
public NubType ReturnType { get; } = returnType;
|
||||
|
||||
public sealed class Param(List<Token> tokens, TokenIdent name, NubType type) : TypedNode(tokens)
|
||||
{
|
||||
public readonly TokenIdent Name = name;
|
||||
public readonly NubType Type = type;
|
||||
public TokenIdent Name { get; } = name;
|
||||
public NubType Type { get; } = type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,99 +414,99 @@ public abstract class TypedNodeStatement(List<Token> tokens) : TypedNode(tokens)
|
||||
|
||||
public sealed class TypedNodeStatementBlock(List<Token> tokens, List<TypedNodeStatement> statements) : TypedNodeStatement(tokens)
|
||||
{
|
||||
public readonly List<TypedNodeStatement> Statements = statements;
|
||||
public List<TypedNodeStatement> Statements { get; } = statements;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeStatementFuncCall(List<Token> tokens, TypedNodeExpression target, List<TypedNodeExpression> parameters) : TypedNodeStatement(tokens)
|
||||
{
|
||||
public readonly TypedNodeExpression Target = target;
|
||||
public readonly List<TypedNodeExpression> Parameters = parameters;
|
||||
public TypedNodeExpression Target { get; } = target;
|
||||
public List<TypedNodeExpression> Parameters { get; } = parameters;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeStatementReturn(List<Token> tokens, TypedNodeExpression value) : TypedNodeStatement(tokens)
|
||||
{
|
||||
public readonly TypedNodeExpression Value = value;
|
||||
public TypedNodeExpression Value { get; } = value;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeStatementVariableDeclaration(List<Token> tokens, TokenIdent name, NubType type, TypedNodeExpression value) : TypedNodeStatement(tokens)
|
||||
{
|
||||
public readonly TokenIdent Name = name;
|
||||
public readonly NubType Type = type;
|
||||
public readonly TypedNodeExpression Value = value;
|
||||
public TokenIdent Name { get; } = name;
|
||||
public NubType Type { get; } = type;
|
||||
public TypedNodeExpression Value { get; } = value;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeStatementAssignment(List<Token> tokens, TypedNodeExpression target, TypedNodeExpression value) : TypedNodeStatement(tokens)
|
||||
{
|
||||
public readonly TypedNodeExpression Target = target;
|
||||
public readonly TypedNodeExpression Value = value;
|
||||
public TypedNodeExpression Target { get; } = target;
|
||||
public TypedNodeExpression Value { get; } = value;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeStatementIf(List<Token> tokens, TypedNodeExpression condition, TypedNodeStatement thenBlock, TypedNodeStatement? elseBlock) : TypedNodeStatement(tokens)
|
||||
{
|
||||
public readonly TypedNodeExpression Condition = condition;
|
||||
public readonly TypedNodeStatement ThenBlock = thenBlock;
|
||||
public readonly TypedNodeStatement? ElseBlock = elseBlock;
|
||||
public TypedNodeExpression Condition { get; } = condition;
|
||||
public TypedNodeStatement ThenBlock { get; } = thenBlock;
|
||||
public TypedNodeStatement? ElseBlock { get; } = elseBlock;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeStatementWhile(List<Token> tokens, TypedNodeExpression condition, TypedNodeStatement block) : TypedNodeStatement(tokens)
|
||||
{
|
||||
public readonly TypedNodeExpression Condition = condition;
|
||||
public readonly TypedNodeStatement Block = block;
|
||||
public TypedNodeExpression Condition { get; } = condition;
|
||||
public TypedNodeStatement Block { get; } = block;
|
||||
}
|
||||
|
||||
public abstract class TypedNodeExpression(List<Token> tokens, NubType type) : TypedNode(tokens)
|
||||
{
|
||||
public readonly NubType Type = type;
|
||||
public NubType Type { get; } = type;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeExpressionIntLiteral(List<Token> tokens, NubType type, TokenIntLiteral value) : TypedNodeExpression(tokens, type)
|
||||
{
|
||||
public readonly TokenIntLiteral Value = value;
|
||||
public TokenIntLiteral Value { get; } = value;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeExpressionStringLiteral(List<Token> tokens, NubType type, TokenStringLiteral value) : TypedNodeExpression(tokens, type)
|
||||
{
|
||||
public readonly TokenStringLiteral Value = value;
|
||||
public TokenStringLiteral Value { get; } = value;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeExpressionBoolLiteral(List<Token> tokens, NubType type, TokenBoolLiteral value) : TypedNodeExpression(tokens, type)
|
||||
{
|
||||
public readonly TokenBoolLiteral Value = value;
|
||||
public TokenBoolLiteral Value { get; } = value;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeExpressionStructLiteral(List<Token> tokens, NubType type, List<TypedNodeExpressionStructLiteral.Initializer> initializers) : TypedNodeExpression(tokens, type)
|
||||
{
|
||||
public readonly List<Initializer> Initializers = initializers;
|
||||
public List<Initializer> Initializers { get; } = initializers;
|
||||
|
||||
public sealed class Initializer(List<Token> tokens, TokenIdent name, TypedNodeExpression value) : Node(tokens)
|
||||
{
|
||||
public readonly TokenIdent Name = name;
|
||||
public readonly TypedNodeExpression Value = value;
|
||||
public TokenIdent Name { get; } = name;
|
||||
public TypedNodeExpression Value { get; } = value;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class TypedNodeExpressionMemberAccess(List<Token> tokens, NubType type, TypedNodeExpression target, TokenIdent name) : TypedNodeExpression(tokens, type)
|
||||
{
|
||||
public readonly TypedNodeExpression Target = target;
|
||||
public readonly TokenIdent Name = name;
|
||||
public TypedNodeExpression Target { get; } = target;
|
||||
public TokenIdent Name { get; } = name;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeExpressionLocalIdent(List<Token> tokens, NubType type, TokenIdent value) : TypedNodeExpression(tokens, type)
|
||||
{
|
||||
public readonly TokenIdent Value = value;
|
||||
public TokenIdent Value { get; } = value;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeExpressionModuleIdent(List<Token> tokens, NubType type, TokenIdent module, TokenIdent value) : TypedNodeExpression(tokens, type)
|
||||
{
|
||||
public readonly TokenIdent Module = module;
|
||||
public readonly TokenIdent Value = value;
|
||||
public TokenIdent Module { get; } = module;
|
||||
public TokenIdent Value { get; } = value;
|
||||
}
|
||||
|
||||
public sealed class TypedNodeExpressionBinary(List<Token> tokens, NubType type, TypedNodeExpression left, TypedNodeExpressionBinary.Op operation, TypedNodeExpression right) : TypedNodeExpression(tokens, type)
|
||||
{
|
||||
public readonly TypedNodeExpression Left = left;
|
||||
public readonly Op Operation = operation;
|
||||
public readonly TypedNodeExpression Right = right;
|
||||
public TypedNodeExpression Left { get; } = left;
|
||||
public Op Operation { get; } = operation;
|
||||
public TypedNodeExpression Right { get; } = right;
|
||||
|
||||
public enum Op
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user