namespace NubLang.TypeChecking.Node;

public abstract record StatementNode : Node;

public abstract record TerminalStatementNode : StatementNode;

public record BlockNode(List<StatementNode> Statements) : StatementNode;

public record StatementFuncCallNode(FuncCallNode FuncCall) : StatementNode;

public record StatementStructFuncCallNode(StructFuncCallNode StructFuncCall) : StatementNode;

public record ReturnNode(ExpressionNode? Value) : TerminalStatementNode;

public record AssignmentNode(LValueExpressionNode Target, ExpressionNode Value) : StatementNode;

public record IfNode(ExpressionNode Condition, BlockNode Body, Variant<IfNode, BlockNode>? Else) : StatementNode;

public record VariableDeclarationNode(string Name, ExpressionNode? Assignment, NubType Type) : StatementNode;

public record ContinueNode : TerminalStatementNode;

public record BreakNode : TerminalStatementNode;

public record WhileNode(ExpressionNode Condition, BlockNode Body) : StatementNode;

public record DeferNode(StatementNode Statement) : StatementNode;