pub enum TemplateArg<'a> {
Dollar(&'a str),
DollarQualified {
alias: &'a str,
name: &'a str,
keys: Vec<String>,
},
Str(&'a str),
Map(&'a str),
List(&'a str),
Scalar(&'a str),
ConstRef {
alias: &'a str,
name: &'a str,
},
KeyPath {
base: &'a str,
keys: Vec<String>,
},
Var(&'a str),
Invalid(&'a str),
}Expand description
One placeholder call argument’s shape. Single owner for the argument grammar: every path classifies here, then acts on the result with its own types and errors.
Variants§
Dollar(&'a str)
$ variable path: raw rest after $ (validate with
parse_var_path). Never holds ALIAS::NAME: valid shapes
classify as TemplateArg::DollarQualified, malformed ones
as TemplateArg::Invalid.
DollarQualified
$ALIAS::NAME with optional .key tail: both resolve, the
tail traversing the CONST value exactly like $base.key.
Single owner for the split (see parse_dollar_qualified),
so no call site restates crate::constants::split_qualified.
Str(&'a str)
String literal source in any spelling (parse with
parse_string_literal).
Map(&'a str)
{...} map inner source.
List(&'a str)
[...] list inner source.
Scalar(&'a str)
Bare scalar source (true, false, numbers; see
parse_scalar_literal).
ConstRef
Bare ALIAS::NAME shape. Never resolves: phases reject it
with bare_sigil_error.
KeyPath
Bare NAME.key... path (validated by parse_bare_key_path).
Never resolves: phases reject it with bare_sigil_error.
Var(&'a str)
Bare NAME identifier. Never resolves: phases reject it with
bare_sigil_error (use $NAME).
Invalid(&'a str)
Anything else: the caller owns the invalid-syntax error.