ESCalc - v0.0.1-beta.2
    Preparing search index...

    Class StandardEvaluator

    The tree-walk evaluator that traverses a LogicalExpression AST and produces a result.

    Extends AbstractVisitor<unknown> and implements every visit method by delegating operator evaluation to the provided Calculator.

    You generally do not need to instantiate this class directly - use evaluate or execute instead. Construct it manually only when you need fine-grained control over the evaluation lifecycle.

    import { parse, StandardEvaluator, StandardCalculator } from 'escalc';

    const ast = parse('1 + [x]');
    const evaluator = new StandardEvaluator({
    params: new Map([['x', 5]]),
    lazyParams: new Map(),
    functions: new Map(),
    calculator: new StandardCalculator(),
    });
    evaluator.logical(ast); // => 6

    Hierarchy (View Summary)

    Index

    Constructors

    Methods