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),
Invalid(&'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.
Valid ALIAS::NAME shapes classify as
PlaceholderKey::DollarQualified; malformed qualified tails
(see is_malformed_dollar_qualified) classify as
PlaceholderKey::Invalid, never here.
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.
Both shapes resolve: the tail traverses the CONST value
exactly like $base.key.
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).
Invalid(&'a str)
Malformed $ALIAS::NAME shape (see
is_malformed_dollar_qualified). Never resolves and never
masquerades as PlaceholderKey::Dollar: phases reject it
with the invalid-placeholder-key diagnostic, exactly like
TemplateArg::Invalid does for call args.
Bare(&'a str)
Anything else, verbatim: script-var lookup, step-override lookup, or a hard error, per the caller’s contract.