pub struct Compiler {
pub constants: Vec<Rc<Object>>,
pub symbol_table: SymbolTable,
/* private fields */
}Fields§
§constants: Vec<Rc<Object>>§symbol_table: SymbolTableImplementations§
Source§impl Compiler
impl Compiler
pub fn new() -> Compiler
pub fn new_with_state( symbol_table: SymbolTable, constants: Vec<Rc<Object>>, ) -> Compiler
pub fn compile(&mut self, node: &Node) -> Result<Bytecode, String>
pub fn bytecode(&self) -> Bytecode
pub fn add_constant(&mut self, obj: Object) -> usize
pub fn emit(&mut self, op: Opcode, operands: &Vec<usize>) -> usize
pub fn emit_with_span( &mut self, op: Opcode, operands: &Vec<usize>, span: &Span, ) -> usize
pub fn add_instructions(&mut self, ins: &Instructions) -> usize
Auto Trait Implementations§
impl !RefUnwindSafe for Compiler
impl !Send for Compiler
impl !Sync for Compiler
impl !UnwindSafe for Compiler
impl Freeze for Compiler
impl Unpin for Compiler
impl UnsafeUnpin for Compiler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more