// Path: app/src/main/java/com/annimon/hotarufx/exceptions/FunctionNotFoundException.java
// public class FunctionNotFoundException extends HotaruRuntimeException {
// 
//     public FunctionNotFoundException(String name, SourcePosition start, SourcePosition end) {
//         super("Function " + name + " does not exists", start, end);
//     }
// }
// 
// Path: app/src/main/java/com/annimon/hotarufx/exceptions/TypeException.java
// public class TypeException extends HotaruRuntimeException {
// 
//     public TypeException(String message) {
//         super(message);
//     }
// 
//     public TypeException(String message, SourcePosition start, SourcePosition end) {
//         super(message, start, end);
//     }
// }
// 
// Path: app/src/main/java/com/annimon/hotarufx/exceptions/VariableNotFoundException.java
// public class VariableNotFoundException extends HotaruRuntimeException {
// 
//     public VariableNotFoundException(String variable, SourcePosition start, SourcePosition end) {
//         super("Variable " + variable + " does not exists", start, end);
//     }
// }


import com.annimon.hotarufx.exceptions.FunctionNotFoundException;
import com.annimon.hotarufx.exceptions.TypeException;
import com.annimon.hotarufx.exceptions.VariableNotFoundException;
import com.annimon.hotarufx.lib.*;
import com.annimon.hotarufx.parser.ast.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;
        return new ArrayValue(elements);
    }

    @Override
    public Value visit(AssignNode node, Context context) {
        final var value = node.value.accept(this, context);
        return node.target.set(this, value, context);
    }

    @Override
    public Value visit(BlockNode node, Context context) {
        Value last = NumberValue.ZERO;
        for (Node statement : node.statements) {
            last = statement.accept(this, context);
        }
        return last;
    }

    @Override
    public Value visit(FunctionNode node, Context context) {
        final var value = node.functionNode.accept(this, context);
        final Function function;
        switch (value.type()) {
            case Types.FUNCTION:
                function = ((FunctionValue) value).getValue();
                break;
            default:
                final var functionName = value.asString();
                function = context.functions().get(functionName);
                if (function == null)
// Path: app/src/main/java/com/annimon/hotarufx/exceptions/FunctionNotFoundException.java
// public class FunctionNotFoundException extends HotaruRuntimeException {
// 
//     public FunctionNotFoundException(String name, SourcePosition start, SourcePosition end) {
//         super("Function " + name + " does not exists", start, end);
//     }
// }
// 
// Path: app/src/main/java/com/annimon/hotarufx/exceptions/TypeException.java
// public class TypeException extends HotaruRuntimeException {
// 
//     public TypeException(String message) {
//         super(message);
//     }
// 
//     public TypeException(String message, SourcePosition start, SourcePosition end) {
//         super(message, start, end);
//     }
// }
// 
// Path: app/src/main/java/com/annimon/hotarufx/exceptions/VariableNotFoundException.java
// public class VariableNotFoundException extends HotaruRuntimeException {
// 
//     public VariableNotFoundException(String variable, SourcePosition start, SourcePosition end) {
//         super("Variable " + variable + " does not exists", start, end);
//     }
// }


// Path: app/src/main/java/com/annimon/hotarufx/parser/visitors/InterpreterVisitor.java
import com.annimon.hotarufx.exceptions.FunctionNotFoundException;
import com.annimon.hotarufx.exceptions.TypeException;
import com.annimon.hotarufx.exceptions.VariableNotFoundException;
import com.annimon.hotarufx.lib.*;
import com.annimon.hotarufx.parser.ast.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;

        return new ArrayValue(elements);
    }

    @Override
    public Value visit(AssignNode node, Context context) {
        final var value = node.value.accept(this, context);
        return node.target.set(this, value, context);
    }

    @Override
    public Value visit(BlockNode node, Context context) {
        Value last = NumberValue.ZERO;
        for (Node statement : node.statements) {
            last = statement.accept(this, context);
        }
        return last;
    }

    @Override
    public Value visit(FunctionNode node, Context context) {
        final var value = node.functionNode.accept(this, context);
        final Function function;
        switch (value.type()) {
            case Types.FUNCTION:
                function = ((FunctionValue) value).getValue();
                break;
            default:
                final var functionName = value.asString();
                function = context.functions().get(functionName);
                if (function == null)
                    throw new FunctionNotFoundException(functionName, node.start(), node.end());