Skip to main content

resolve_value_reference

Function resolve_value_reference 

Source
pub fn resolve_value_reference(
    expr: &str,
    vars: &HashMap<String, String>,
) -> String
Expand description

v2.17.0 — resolve a VALUE-POSITION expression (a for … in <expr> iterable, a return <expr>) against the runtime bindings. These positions carry no frontend value_kind classification (unlike a v2.10.0 kwarg), so this resolves the three reference forms a flow author writes, in order:

  1. "${X}" / "${e.field}" / $name — string interpolation (incl. the v2.17.0 dotted field-access). Detected by a $ anywhere in the expr.
  2. Step.output — a step’s output. Steps bind their output under their BARE NAME (pure_shape / the v1.31.0 contract), so a trailing .output maps to the step-name key. This is the canonical form an author writes for for e in ClassifyEdges.output / return Step.output (the same .output sugar resolve_named_arg_value handles for kwargs).
  3. name — a bare let / flow-param / step binding.

Falls back to the verbatim expr when nothing resolves (a genuine literal). Mirrors the persist field-value resolution (store_rowinterpolate_vars) so a reference resolves identically in EVERY value position (the v2.17.0 fix: a for-iterable + a return previously did a bare exact-key lookup, so ClassifyEdges.output / ${Summarize} reached the runtime as the literal).