pub enum PlaceholderKey<'a> {
Empty,
Dollar(&'a str),
DollarQualified {
alias: &'a str,
name: &'a str,
keys: Vec<String>,
},
Env(&'a str),
ScriptEnv(&'a str),
Call(PlaceholderCall<'a>),
ConstRef {
alias: &'a str,
name: &'a str,
},
KeyPath {
base: &'a str,
keys: Vec<String>,
},
Var(&'a str),
Bare(&'a str),
}Expand description
One {{ ... }} key, classified. The single grammar behind every
expansion and check phase: parse-time qualification, the static
gate, script-engine expansion, and override-map expansion all route
through this, so the phases can never disagree on what shape a key
is. Payloads stay raw (untrimmed, unsplit): trimming, splitting,
lookup sources, and errors belong to the caller, whose contracts
differ. Input must arrive trimmed: every producer trims at its
boundary (TemplateSegments yields trimmed keys; the streaming
expander trims on extract).
Variants§
Empty
Empty key: every phase rejects it.
Dollar(&'a str)
$ plus the raw rest: split through split_var_path.
Never holds ALIAS::NAME: those classify as
PlaceholderKey::DollarQualified.
DollarQualified
$ALIAS::NAME with optional .key tail. Single owner for
the split (see parse_dollar_qualified), so no call site
restates crate::constants::split_qualified.
The empty-tail shape resolves; a .key tail fails with
qualified_keypath_error.
Env(&'a str)
env: plus the raw name.
ScriptEnv(&'a str)
script_env: plus the raw name.
Call(PlaceholderCall<'a>)
One [MODULE::]FUNC(args) body, through the shared
parse_placeholder_call grammar.
ConstRef
Bare ALIAS::NAME shape. Never resolves: phases reject it
with bare_sigil_error (use $ALIAS::NAME).
KeyPath
Bare NAME.key... shape (keys validated non-empty, no
spaces or commas; base is a bare identifier). Never resolves:
phases reject it with bare_sigil_error.
Var(&'a str)
Bare identifier shape (NAME). Never resolves: phases reject
it with bare_sigil_error (use $NAME).
Bare(&'a str)
Anything else, verbatim: script-var lookup, step-override lookup, or a hard error, per the caller’s contract.