pub enum UseArgs {
LegacyPositional(String),
Named(Vec<(String, String, String)>),
}Expand description
§Fase 58.b — the closed catalog of use <Tool> argument forms. The
invocation surfaces are mutually exclusive, so a sum type models them
exactly (no ambiguous dual-empty state). NOTE: apply: Tool given: <struct>
(the splat form) is NOT here — it rides StepNode.apply_ref and is
validated against the tool schema in §58.d, not parsed as a use.
Variants§
LegacyPositional(String)
use Tool on "${arg}" / use Tool on query — the §54.b single
positional argument. D5 back-compat: behaves byte-identically to the
pre-58 argument: String (empty string when no on clause).
Named(Vec<(String, String, String)>)
use Tool(query = "${q}", max_results = 5) — D2 canonical multi-field
keyword args. Each entry is (name, value, value_kind): value is the
expression STRING (the frontend has no structured Expr; mirrors
argument / parse_argument_list); value_kind is "literal" or
"reference" — the §Fase 60 classification from parse_let_atom, so the
runtime resolves a bare identifier / Step.output as a binding lookup
(like let) instead of passing the name literally. The type-checker
(§58.d + §60.c) validates each entry against the tool’s declared input
schema (W2 / CT-2 caller blame) and references against their source.
Implementations§
Source§impl UseArgs
impl UseArgs
Sourcepub fn legacy_argument(&self) -> String
pub fn legacy_argument(&self) -> String
§58.b transitional — the legacy single-arg string for the IR argument
field (still String until §58.c carries structured named args).
Named projects an empty argument here; the type-checker validates
named args from the AST, and §58.c/e wire their structured dispatch.