pub enum MathArgBody {
Math {
mgrp: MathGroup<()>,
elems: Vec<MathErased>,
},
Inline {
igrp: InlineGroup<()>,
elems: Vec<InlineElem>,
},
Block {
bgrp: BlockGroup<()>,
elems: Vec<BlockElem>,
},
ParenEscape {
paren: ParenGroup<()>,
inner: Box<ParenBody>,
},
ListEscape {
list: ListGroup<()>,
items: Vec<ListItem>,
},
RecordEscape {
rec: RecordGroup<()>,
body: RecordBody,
},
}Expand description
The six body shapes shared by mandatory and ?:-optional math args:
a math/inline/block group, or a !-escaped program-mode value. The
lexer already switches mode on the escape sigil (!( / ![ / !(| /
!{ / !< all emit ordinary LParen/BList/BRecord/BHorzGrp/
BVertGrp tokens — see lexer.rs’s lex_math), so at the token
level the escapes are indistinguishable from Atomic’s own
Paren/List/Record shapes; reusing those bodies directly here
(rather than going through a full ExprErased, which would also
happily swallow a following matharg bracket group as a trailing
application argument) keeps each matharg exactly one bracket group.
NOT Box<MathArg>: a direct self-loop on a non-root type is what
#[recurse] rejects, and upstream’s grammar is non-recursive here
anyway.
Variants§
Math
{ math }.
Inline
!{ inline text }.
Block
!<block text>.
ParenEscape
!(e) / !(e, e, …).
ListEscape
![e; …].
RecordEscape
!(|l = e; …|).
Trait Implementations§
Source§impl Clone for MathArgBody
impl Clone for MathArgBody
Source§fn clone(&self) -> MathArgBody
fn clone(&self) -> MathArgBody
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MathArgBody
impl Debug for MathArgBody
Source§impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for MathArgBodywhere
__SyanMacro_Atom: Spanned + Clone,
MathGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_mgrp_MathArgBody_Math_13316143612193599257: Parse<__SyanMacro_Atom>,
InlineGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_igrp_MathArgBody_Inline_13316143612193599257: Parse<__SyanMacro_Atom>,
BlockGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_bgrp_MathArgBody_Block_13316143612193599257: Parse<__SyanMacro_Atom>,
ParenGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_paren_MathArgBody_ParenEscape_13316143612193599257: Parse<__SyanMacro_Atom>,
ListGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_list_MathArgBody_ListEscape_13316143612193599257: Parse<__SyanMacro_Atom>,
RecordGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_rec_MathArgBody_RecordEscape_13316143612193599257: Parse<__SyanMacro_Atom>,
impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for MathArgBodywhere
__SyanMacro_Atom: Spanned + Clone,
MathGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_mgrp_MathArgBody_Math_13316143612193599257: Parse<__SyanMacro_Atom>,
InlineGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_igrp_MathArgBody_Inline_13316143612193599257: Parse<__SyanMacro_Atom>,
BlockGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_bgrp_MathArgBody_Block_13316143612193599257: Parse<__SyanMacro_Atom>,
ParenGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_paren_MathArgBody_ParenEscape_13316143612193599257: Parse<__SyanMacro_Atom>,
ListGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_list_MathArgBody_ListEscape_13316143612193599257: Parse<__SyanMacro_Atom>,
RecordGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_rec_MathArgBody_RecordEscape_13316143612193599257: Parse<__SyanMacro_Atom>,
Source§type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
type Error = ParseError<<__SyanMacro_Atom as Spanned>::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.