Skip to main content

Module exec

Module exec 

Source
Expand description

Parser for the Exec mini-language (the value of an Exec: directive).

Grammar (informal):

exec := pipeline pipeline := stage (“|” stage)* stage := source | command source := value_ref (a single bare ref by itself) command := token (ws+ token)* token := group | text group := “[” piece (ws+ piece)* “]” piece := text-without-spaces (with {...} interpolations) text := (literal | “{” value_ref “}” | quoted_str)+ value_ref := “%” ident | “:” ident | “^” ident | “@” ident | “$” | “$.” ident (“.” ident)*

This module is purely syntactic: it produces an ExecStage AST. Argv construction and process spawning live in crate::exec.

Functions§

parse_exec
Parse the Exec value. start is the absolute byte offset of the first character in the source, used to translate spans for diagnostics.