using System.Collections.Generic;
namespace YesNt.Interpreter.Runtime;
///
/// Represents one frame on the function call stack. Created when a call statement is
/// executed and popped when the matching return is reached.
///
internal class FunctionScope(int callerLine, Stack arguments)
{
/// Gets the zero-based line index to return to after this function completes.
public int CallerLine { get; } = callerLine;
/// Gets the local variable table for this function invocation.
public Dictionary Variables { get; } = [];
/// Gets the local list table for this function invocation.
public Dictionary> Lists { get; } = [];
/// Gets the local map table for this function invocation.
public Dictionary> Maps { get; } = [];
/// Gets the local label table for this function invocation.
public Dictionary Labels { get; } = [];
/// Gets the stack of input arguments passed to this function via push_in.
public Stack Arguments { get; } = arguments;
/// Gets the stack of output values pushed via push_out, consumed by the caller via %out.
public Stack Results { get; } = new();
}