pub struct OpNameTok {
pub name: String,
pub span: Span,
pub lparen: LParenTok,
pub op: NamingOpTok,
pub rparen: RParenTok,
}Expand description
( ‹op› ) — a parenthesized (possibly user-defined) operator name.
Two surface uses share this leaf: a binding-position NAME (cst.rs’s
BindName, e.g. let (+++>) = .. / val (-->) : ty — the gap blocking
itemize.satyh/progsynt.satyh) and a bare atomic-expression reference
to an operator as a first-class value (cst.rs’s ast::Atomic::OpRef,
e.g. (+++)). .name is the operator’s text (NamingOpTok::op_text);
.span covers the whole ( .. ), delimiters included. Both are
precomputed here (rather than left to the Spanned trait) so a
downstream crate with no direct syan dependency (rustyfi-lang) can
read them as plain fields, exactly like every other leaf’s .name/
.span. Hand-written (not #[leaf(...)]-generated) for the same reason
as BinOpTok: it spans three atoms, not one. The inner operator is a
NamingOpTok (not a bare BinOpTok) so (!)/(before) — valid
only in this naming position, per upstream’s binop nonterminal — also
parse; see NamingOpTok’s doc comment.
Fields§
§name: String§span: Span§lparen: LParenTok§op: NamingOpTok§rparen: RParenTokTrait Implementations§
Source§impl Parse<WithSpan<Token, Span>> for OpNameTok
impl Parse<WithSpan<Token, Span>> for OpNameTok
Source§type Error = ParseError<Span>
type Error = ParseError<Span>
<FieldTy as Parse<Atom>>::Error: Into<…> predicate re-creates a projection cycle on a
recursive field (E0275), which decycle’s bound-peeling does not break.