/** * Three questions about a source expression that decide where the two * languages part, answered from the source tree before anything is written. * * **Can it be absent?** The source dialect answers a comparison with an absent * side `false`, where OpenScript answers `none` (`language.md` 6.4). Most * places treat the two alike, because a condition that is absent takes the * false branch; the places that do not are `not`, an equality with a boolean * literal and a condition handed to a counting built-in, and there the * translation writes `orElse(x, false)`, which is the source dialect's answer * exactly. The analysis is conservative: anything it cannot show is present is * treated as possibly absent, which costs an `orElse` that changes nothing. * * **Does it hold state?** A call that keeps state at its call site, or a user * function that may, is one whose value depends on which bars it ran on * (`language.md` 11.4). That is where the order and laziness of evaluation * stop being invisible. * * **Is it a whole-number constant?** Version 5 of the source dialect divides * two of those without a fraction. */ import type { Context } from './context.js'; import type { Expr } from './syntax.js'; /** Whether an expression holds a value on every bar, as far as the tree can show. */ export declare function neverAbsent(ctx: Context, expr: Expr | undefined): boolean; /** Whether evaluating an expression runs a call that keeps state at its call site. */ export declare function holdsState(ctx: Context, expr: Expr): boolean; /** Whether an expression is a whole-number constant in version 5's sense. */ export declare function wholeConstant(ctx: Context, expr: Expr): boolean; /** Whether a name is read anywhere inside an expression. */ export declare function mentions(expr: Expr, name: string): boolean; //# sourceMappingURL=presence.d.ts.map