[−][src]Enum inc::AST
The LISP AST
The canonical type to represent lisp programs. The parser parses the input program to generate an AST. See tests for several examples.
Variants
Nil
Number(i64)
Boolean(bool)
Char(u8)
A unicode char encoded in UTF-8 can take upto 4 bytes and won't fit in a word; so this implementation makes sense only for ASCII.
Identifier(String)
List(Vec<AST>)
Since Rust needs to know the size of the AST type upfront, we need an
indirection here with Vec<>
for recursive types. In this context, Vec
is just a convenient way to have a Box<[AST]>
Let
Fields of Let
Trait Implementations
impl PartialEq<AST> for AST
[src]
impl From<i64> for AST
[src]
Idiomatic type conversions from the primitive types to AST
https://doc.rust-lang.org/rust-by-example/conversion/from_into.html https://ricardomartins.cc/2016/08/03/convenient_and_idiomatic_conversions_in_rust
impl From<bool> for AST
[src]
impl From<char> for AST
[src]
impl<'_> From<&'_ str> for AST
[src]
impl Debug for AST
[src]
impl FromStr for AST
[src]
Parse the input from user into the form the top level of the compiler understands.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,