pub enum Atomic {
Show 19 variants
Length(LengthTok),
Float(FloatTok),
Int(IntTok),
Literal(LiteralTok),
True(KwTrue),
False(KwFalse),
Ctor(CtorTok),
Var(VarTok),
VarWithMod(VarWithModTok),
OpRef(OpNameTok),
Command {
kw: CommandTok,
name: AnyHorzCmdTok,
},
Unit {
paren: UnitParen,
},
Paren {
paren: ParenGroup<()>,
inner: Box<ParenBody>,
},
OpenModule {
grp: OpenModuleGroup<()>,
body: Box<ParenBody>,
},
Record {
rec: RecordGroup<()>,
body: RecordBody,
},
List {
list: ListGroup<()>,
items: Vec<ListItem>,
},
InlineText {
igrp: InlineGroup<()>,
elems: Vec<InlineElem>,
},
BlockText {
bgrp: BlockGroup<()>,
elems: Vec<BlockElem>,
},
MathText {
mgrp: MathGroup<()>,
elems: Vec<MathErased>,
},
}Expand description
nxbot (plus the ctor-head case usually found in nxun): an atomic
expression.
Variants§
Length(LengthTok)
Float(FloatTok)
Int(IntTok)
Literal(LiteralTok)
True(KwTrue)
False(KwFalse)
Ctor(CtorTok)
A bare constructor, e.g. None, or the head of Some 1.
Var(VarTok)
VarWithMod(VarWithModTok)
Mod.x — a module-qualified variable (VARWITHMOD).
OpRef(OpNameTok)
( ‹op› ) — a bare reference to a (possibly user-defined)
operator as a first-class value, e.g. (+++), (-->)
(nxbot’s LPAREN binop RPAREN alternative — the same syntax
super::BindName accepts in binding position, here used as an
ordinary atomic expression). Resolves via the same name
BinOpTok::op_text yields, exactly like Var (elaborate.rs).
Command
command \cmd (upstream nxapp: COMMAND hcmd →
UTContentOf(mods, csnm)): a first-class value that simply
names an inline command’s own binding — no argument tail, so
modeling it as an atom (rather than upstream’s nxapp level)
is strictly simpler and covers every bundled usage (always
parenthesized, e.g. (command \math)). Only the horizontal
form is spelled upstream; if a package ever writes command +cmd/a math form, extend with an AnyVertCmdTok/math
alternative then.
Unit
()
Paren
( expr ) or ( expr, expr, … ) (the latter elaborates to a
tuple).
OpenModule
Mod.(e) ≡ open Mod in e (nxbot’s OPENMODULE nxlet RPAREN
production). Reuses ParenBody exactly like Atomic::Paren
above (so Mod.(e, e, …) would elaborate to a tuple the same
way, though no bundled package writes it that way) — the Mod.(
sigil is the open delimiter (OpenModuleTok, carrying the
module name), closed by a plain ). Elaborated via the same
machinery as Expr::OpenIn (elaborate.rs’s open_module
helper).
Record
(| label = expr; … |) or (| base with label = expr; … |)
(nxrecordsynt; see RecordBody).
List
[ expr; … ]
InlineText
{ inline text }
BlockText
'< block text >
MathText
${ math } (nxbot’s BMATHGRP mathblock EMATHGRP case).
Trait Implementations§
Source§impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for Atomicwhere
__SyanMacro_Atom: Spanned + Clone,
LengthTok: Parse<__SyanMacro_Atom>,
FloatTok: Parse<__SyanMacro_Atom>,
IntTok: Parse<__SyanMacro_Atom>,
LiteralTok: Parse<__SyanMacro_Atom>,
KwTrue: Parse<__SyanMacro_Atom>,
KwFalse: Parse<__SyanMacro_Atom>,
CtorTok: Parse<__SyanMacro_Atom>,
VarTok: Parse<__SyanMacro_Atom>,
VarWithModTok: Parse<__SyanMacro_Atom>,
OpNameTok: Parse<__SyanMacro_Atom>,
CommandTok: Parse<__SyanMacro_Atom>,
AnyHorzCmdTok: Parse<__SyanMacro_Atom>,
UnitParen: Parse<__SyanMacro_Atom>,
ParenGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_paren_Atomic_Paren_672281474488818023: Parse<__SyanMacro_Atom>,
OpenModuleGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_grp_Atomic_OpenModule_672281474488818023: Parse<__SyanMacro_Atom>,
RecordGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_rec_Atomic_Record_672281474488818023: Parse<__SyanMacro_Atom>,
ListGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_list_Atomic_List_672281474488818023: Parse<__SyanMacro_Atom>,
InlineGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_igrp_Atomic_InlineText_672281474488818023: Parse<__SyanMacro_Atom>,
BlockGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_bgrp_Atomic_BlockText_672281474488818023: Parse<__SyanMacro_Atom>,
MathGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_mgrp_Atomic_MathText_672281474488818023: Parse<__SyanMacro_Atom>,
impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for Atomicwhere
__SyanMacro_Atom: Spanned + Clone,
LengthTok: Parse<__SyanMacro_Atom>,
FloatTok: Parse<__SyanMacro_Atom>,
IntTok: Parse<__SyanMacro_Atom>,
LiteralTok: Parse<__SyanMacro_Atom>,
KwTrue: Parse<__SyanMacro_Atom>,
KwFalse: Parse<__SyanMacro_Atom>,
CtorTok: Parse<__SyanMacro_Atom>,
VarTok: Parse<__SyanMacro_Atom>,
VarWithModTok: Parse<__SyanMacro_Atom>,
OpNameTok: Parse<__SyanMacro_Atom>,
CommandTok: Parse<__SyanMacro_Atom>,
AnyHorzCmdTok: Parse<__SyanMacro_Atom>,
UnitParen: Parse<__SyanMacro_Atom>,
ParenGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_paren_Atomic_Paren_672281474488818023: Parse<__SyanMacro_Atom>,
OpenModuleGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_grp_Atomic_OpenModule_672281474488818023: Parse<__SyanMacro_Atom>,
RecordGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_rec_Atomic_Record_672281474488818023: Parse<__SyanMacro_Atom>,
ListGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_list_Atomic_List_672281474488818023: Parse<__SyanMacro_Atom>,
InlineGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_igrp_Atomic_InlineText_672281474488818023: Parse<__SyanMacro_Atom>,
BlockGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_bgrp_Atomic_BlockText_672281474488818023: Parse<__SyanMacro_Atom>,
MathGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_mgrp_Atomic_MathText_672281474488818023: 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.