Enum ess::sexp::Sexp
[−]
[src]
pub enum Sexp<'a, Loc = ByteSpan> where
Loc: Span, { Sym(Cow<'a, str>, Loc), Str(Cow<'a, str>, Loc), Char(char, Loc), Int(i64, Loc), Float(f64, Loc), List(Vec<Sexp<'a, Loc>>, Loc), }
A type representing arbitrary s-expressions.
Sexp
carries the source code location it came from along with it for later
diagnostic purposes.
Variants
Sym(Cow<'a, str>, Loc)
A value representing a symbol.
Str(Cow<'a, str>, Loc)
A value representing a string literal.
Char(char, Loc)
A value representing a single character.
Int(i64, Loc)
A value representing an integer. Any number containing no decimal point
will be parsed as an Int
.
Float(f64, Loc)
A value representing a floating point number. Any number containing a
decimal point will be parsed as a Float
.
List(Vec<Sexp<'a, Loc>>, Loc)
A list of subexpressions.
Methods
impl<'a, Loc> Sexp<'a, Loc> where
Loc: Span,
[src]
Loc: Span,
fn get_loc(&self) -> &Loc
Gives a reference to the source location contained in the Sexp
.
fn get_loc_mut(&mut self) -> &mut Loc
Gives a mutable reference to the Sexp
's source location.
impl<'a, Loc> Sexp<'a, Loc> where
Loc: Span + Clone,
[src]
Loc: Span + Clone,
Trait Implementations
impl<'a, Loc: Debug> Debug for Sexp<'a, Loc> where
Loc: Span,
[src]
Loc: Span,
impl<'a, Loc: PartialEq> PartialEq for Sexp<'a, Loc> where
Loc: Span,
[src]
Loc: Span,
fn eq(&self, __arg_0: &Sexp<'a, Loc>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Sexp<'a, Loc>) -> bool
This method tests for !=
.
impl<'a, Loc: Clone> Clone for Sexp<'a, Loc> where
Loc: Span,
[src]
Loc: Span,
fn clone(&self) -> Sexp<'a, Loc>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'a, Loc: PartialOrd> PartialOrd for Sexp<'a, Loc> where
Loc: Span,
[src]
Loc: Span,
fn partial_cmp(&self, __arg_0: &Sexp<'a, Loc>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Sexp<'a, Loc>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Sexp<'a, Loc>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Sexp<'a, Loc>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Sexp<'a, Loc>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more