pub enum SpannedForm {
Nil,
Atom(Atom),
List(Vec<Spanned>),
Quote(Box<Spanned>),
Quasiquote(Box<Spanned>),
Unquote(Box<Spanned>),
UnquoteSplice(Box<Spanned>),
}Expand description
Same variants as Sexp, but children are Spanned so every subtree
carries its own position.
Variants§
Nil
Atom(Atom)
List(Vec<Spanned>)
Quote(Box<Spanned>)
Quasiquote(Box<Spanned>)
Unquote(Box<Spanned>)
UnquoteSplice(Box<Spanned>)
Implementations§
Source§impl SpannedForm
impl SpannedForm
Sourcepub fn wrap(qf: QuoteForm, inner: Spanned) -> SpannedForm
pub fn wrap(qf: QuoteForm, inner: Spanned) -> SpannedForm
Project a typed QuoteForm marker into its SpannedForm wrapper
variant — the span-carrying dual of QuoteForm::wrap.
The reader’s spanned quote arm routes through here for the same
reason its plain arm routes through QuoteForm::wrap: the
(marker, constructor) pairing binds at ONE site on the closed-set
algebra rather than at four per-arm constructor literals, so adding
a fifth homoiconic prefix extends QuoteForm AND both wrap
tables in lockstep, with rustc binding the extension through
exhaustiveness over the closed enum.
Duality law, pinned by
spanned_form_wrap_is_the_span_carrying_dual_of_quote_form_wrap:
SpannedForm::wrap(qf, s).to_sexp() == qf.wrap(s.to_sexp()) for
every qf in QuoteForm::ALL. This is a real equivalence over the
closed set, not the assert!(true)-shaped claim the pre-
consolidation spanned expander made about its own duplicate.
Trait Implementations§
Source§impl Clone for SpannedForm
impl Clone for SpannedForm
Source§fn clone(&self) -> SpannedForm
fn clone(&self) -> SpannedForm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more