/** * Extraction Operators * * Handles destructure, slice, and spread operations for extracting * values from lists and dicts. * * @internal */ import type { DestructureNode, DestructNode, SliceNode, ListLiteralNode, DictLiteralNode, TupleLiteralNode, OrderedLiteralNode, ExpressionNode, ListSpreadNode } from '../../../../types.js'; import type { RillValue } from '../../types/structures.js'; import type { EvalState } from '../state.js'; /** * Evaluate destructure operator: destruct<$a, $b, $c> * Extracts values from list or dict into variables. * * List destructure: [1, 2, 3] -> destruct<$a, $b, $c> # $a=1, $b=2, $c=3 * Dict destructure: [x: 1, y: 2] -> destruct # $a=1, $b=2 */ export declare function evaluateDestructure(s: EvalState, node: DestructureNode, input: RillValue): Promise; /** * Evaluate slice operator: / * Extracts a portion of a list or string using Python-style slicing. * * Examples: * [0, 1, 2, 3, 4] -> /<0:3> # [0, 1, 2] * [0, 1, 2, 3, 4] -> /<-2:> # [3, 4] * [0, 1, 2, 3, 4] -> /<::-1> # [4, 3, 2, 1, 0] * "hello" -> /<1:4> # "ell" */ export declare function evaluateSlice(s: EvalState, node: SliceNode, input: RillValue): Promise; /** * Evaluate destruct operator: destruct<$a, $b, ...> * Same semantics as evaluateDestructure but for the keyword-based syntax. * Delegates to evaluateDestructure since the pattern structure is identical. */ export declare function evaluateDestruct(s: EvalState, node: DestructNode, input: RillValue): Promise; /** * Evaluate collection literals. * Handles list[...], dict[...], tuple[...], ordered[...] keyword forms. * * Ellipsis spread (...$other) expands referenced collections inline. * Type is fixed by the keyword — no runtime inference from content. * * Returns: * - ListLiteralNode -> RillValue[] (plain list) * - DictLiteralNode -> Record * - TupleLiteralNode -> RillTuple * - OrderedLiteralNode -> RillOrdered */ export declare function evaluateCollectionLiteral(s: EvalState, node: ListLiteralNode | DictLiteralNode | TupleLiteralNode | OrderedLiteralNode): Promise; /** * Evaluate list/tuple literal elements, expanding spread nodes inline. * Spread: ...$other expands the referenced collection into the result. */ export declare function evaluateListLiteralElements(s: EvalState, rawElements: (ExpressionNode | ListSpreadNode)[]): Promise;