[][src]Struct haru::compiler::Compiler

pub struct Compiler {
    pub interned_strings: Option<InternedStringMap>,
    pub modules_info: Rc<RefCell<ModulesInfo>>,
    // some fields omitted
}

Compiler for processing AST nodes and executing generated bytecode in a virtual machine.

Fields

interned_strings: Option<InternedStringMap>modules_info: Rc<RefCell<ModulesInfo>>

Methods

impl Compiler[src]

pub fn new(interned_strings_enabled: bool) -> Compiler[src]

pub fn new_append(
    code: Vec<u8>,
    modules_info: Rc<RefCell<ModulesInfo>>,
    interned_strings: InternedStringMap
) -> Compiler
[src]

pub fn into_vm(&mut self) -> Vm[src]

pub fn into_code(self) -> Vec<u8>[src]

pub fn receive_code(&mut self, code: Vec<u8>)[src]

pub fn take_code(&mut self) -> Vec<u8>[src]

pub fn ctop(&self) -> u8[src]

pub fn clen(&self) -> usize[src]

pub fn cpushop(&mut self, n: VmOpcode)[src]

pub fn cpush8(&mut self, n: u8)[src]

pub fn cpush16(&mut self, n: u16)[src]

pub fn cpush32(&mut self, n: u32)[src]

pub fn cpush64(&mut self, n: u64)[src]

pub fn cpushf64(&mut self, n: f64)[src]

pub fn cpushs<T: Into<Vec<u8>>>(&mut self, s: T) -> Result<(), ()>[src]

pub fn cfill_label8(&mut self, pos: usize, label: u8)[src]

pub fn cfill_label16(&mut self, pos: usize, label: u16)[src]

pub fn code_as_bytes(&self) -> &[u8][src]

pub fn is_in_function(&self) -> bool[src]

pub fn set_local(&mut self, var: String) -> Option<(u16, u16)>[src]

pub fn emit_set_var(&mut self, var: String, is_function: bool)[src]

pub fn emit_get_var(&mut self, var: String)[src]

pub fn reserve_label16(&mut self) -> usize[src]

pub fn fill_label16(&mut self, pos: usize, label: u16)[src]

pub fn scope(&mut self)[src]

pub fn unscope(&mut self) -> u16[src]

pub fn loop_start(&mut self)[src]

pub fn loop_continue(&mut self)[src]

pub fn loop_break(&mut self)[src]

pub fn loop_end(&mut self, next_it_pos: usize, end_pos: usize)[src]

pub fn lookup_smap(&self, bc_idx: usize) -> Option<SourceMap>[src]

Auto Trait Implementations

impl !Send for Compiler

impl !Sync for Compiler

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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