Documentation
¶
Overview ¶
Package exprident is the one parse-only reading of the names an expr-lang expression mentions: the free identifiers it reads from its env and the functions it calls by name. It never compiles or runs an expression.
It imports only the expr-lang parser and AST, so the no-execute layers (internal/vectors, internal/descriptor) and the engine (internal/processing) share it: the vector-reference count that decides PULSE_VECTOR_UNREFERENCED, the names an expression program binds, and the overlay built-in refusal read the same walk and cannot disagree about what an expression names.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Callees ¶
Callees returns the names an expression calls as functions (`name(...)` with an identifier callee), in walk order without repeats; parsed=false when the expression does not parse. Stock expr-lang built-ins (len, abs, ...) parse as BuiltinNode and are not callees.
func FirstCallee ¶
FirstCallee returns the first name, in Callees order, the expression calls for which match reports true; "" when none does or the expression does not parse (a compile then reports the syntax error). The overlay formula built-in refusal reads it at both predict hosts and the runtime compile with exprenv.OverlayRefused.
func Free ¶
Free returns the names an expression reads from its env, in first-use order: every identifier that is not a callee, a let binding or $env, plus `$env.name` / `$env["name"]` members; usesEnv reports any use of $env. parsed=false when the expression does not parse (a compile then reports the syntax error).
Types ¶
type Call ¶
Call is one call of a named function: the callee name and, per argument, the free identifier the argument IS — "" for any other argument (a literal, a nested call such as vcenter(v), an operator expression, a let-bound name or $env).
func Calls ¶
Calls returns every call of a named function in the expression, in walk order (post-order: an inner call before the call enclosing it); parsed=false when the expression does not parse. The vector-kind fit check reads it to judge `cosine(v, w)` on a kind-declared vector: a bare identifier argument is the vector itself, anything else is a transform of it and is not judged.