[−][src]Struct passerine::common::lambda::Lambda
Represents a single interpretable chunk of bytecode, Think a function.
Fields
code: Vec<u8>
spans: Vec<(usize, Span)>
constants: Vec<Data>
captureds: Vec<usize>
Implementations
impl Lambda
[src]
pub fn empty() -> Lambda
[src]
Creates a new empty Lambda to be filled.
pub fn emit(&mut self, op: Opcode)
[src]
Emits an opcode as a byte
pub fn emit_bytes(&mut self, bytes: &mut Vec<u8>)
[src]
Emits a series of bytes
pub fn emit_span(&mut self, span: &Span)
[src]
Emits a span, should be called before an opcode is emmited. This function ties opcodes to spans in source. See index_span as well.
pub fn demit(&mut self)
[src]
Removes the last emitted byte
pub fn index_data(&mut self, data: Data) -> usize
[src]
Given some data, this function adds it to the constants table, and returns the data's index. The constants table is push only, so constants are identified by their index. The resulting usize can be split up into a number byte stream, and be inserted into the bytecode.
pub fn index_span(&mut self, index: usize) -> Span
[src]
Look up the nearest span at or before the index of a specific bytecode op.
Trait Implementations
impl Clone for Lambda
[src]
impl Debug for Lambda
[src]
impl Display for Lambda
[src]
impl Eq for Lambda
[src]
impl PartialEq<Lambda> for Lambda
[src]
impl StructuralEq for Lambda
[src]
impl StructuralPartialEq for Lambda
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Lambda
impl !Send for Lambda
impl !Sync for Lambda
impl Unpin for Lambda
impl !UnwindSafe for Lambda
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,