[][src]Struct spaik::compile::R8Compiler

pub struct R8Compiler<'a, 'b> { /* fields omitted */ }

Compile Value into R8C code.

Implementations

impl<'a, 'b> R8Compiler<'a, 'b>[src]

pub fn new(vm: &'a mut R8VM<'b>) -> R8Compiler<'a, 'b>[src]

pub fn compile_top(&mut self, ret: bool, code: &Value) -> Result<(), Error>[src]

pub fn globals(&self) -> Option<impl Iterator<Item = (&SymID, &usize)>>[src]

pub fn enter_fn(&mut self, args: Vec<SymID>, spec: ArgSpec) -> Result<(), Error>[src]

pub fn compile_fn(
    &mut self,
    _name: SymID,
    args: &Value,
    body: &Value
) -> Result<ArgSpec, Error>
[src]

pub fn argument_clinic(mut code: &Value) -> Result<(bool, &Value), Error>[src]

Reduces nested applications of not

Arguments

  • code : The root of the AST tree to be reduced.

Examples

  • (not <_>)(true, <_>)
  • (not (not (not <_>)))(true, <_>)
  • (not (not (not (not <_>))))(false, <_>)

Where the boolean represents whether or not the expression has been negated.

Errors

Returns an ArgError if not is given fewer or more than 1 argument.

Algorithm

Video explanation.

pub fn bt_eval_when(&mut self, code: &Value) -> Result<Value, Error>[src]

pub fn compile_atom(&mut self, atom: &Value) -> Result<(), Error>[src]

pub fn compile_app(
    &mut self,
    ret: bool,
    op: SymID,
    code: &Value
) -> Result<(), Error>
[src]

Auto Trait Implementations

impl<'a, 'b> !RefUnwindSafe for R8Compiler<'a, 'b>[src]

impl<'a, 'b> !Send for R8Compiler<'a, 'b>[src]

impl<'a, 'b> !Sync for R8Compiler<'a, 'b>[src]

impl<'a, 'b> Unpin for R8Compiler<'a, 'b> where
    'b: 'a, 
[src]

impl<'a, 'b> !UnwindSafe for R8Compiler<'a, 'b>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.