Skip to main content

parse_with_entry

Function parse_with_entry 

Source
pub fn parse_with_entry(input: &str) -> Result<WithEntry, WithEntryParseError>
Expand description

Parse a with-entry from its string form

Grammar:

  entry     := path ("|" transform)* ("??" default)?
  path      := "$" identifier ("." identifier | "[" index "]")*
  transform := name | name "(" args ")"
  default   := json_value

Examples:

  "$step1"                          → simple task ref
  "$step1.data"                     → task ref with field access
  "$step1.data ?? fallback"         → with JSON default
  "$step1.data | upper"             → with transform
  "$step1.data | sort | unique"     → transform chain
  "$step1.data | sort | first(3) ?? []"  → chain + default