Skip to main content

Expander

Struct Expander 

Source
pub struct Expander {
    pub budget_on: bool,
    pub expand_budget: u64,
    pub expand_fired: u64,
    /* private fields */
}
Expand description

The macro table and the application counters: mMacros, mBudgetOn, mExpandBudget and mExpandFired.

Fields§

§budget_on: bool

L15: when on, applications beyond the budget do not fire.

§expand_budget: u64§expand_fired: u64

L1: macro applications since the last reset.

Implementations§

Source§

impl Expander

Source

pub fn new() -> Expander

Source

pub fn get_macro(&self, name: &str) -> Option<&Macro>

VBA GetMacro: by name, folded.

Source

pub fn macro_doc(&self, name: &str) -> String

VBA VlaMacroDoc: a macro’s docstring, or empty.

Source

pub fn define_macro(&mut self, f: &List) -> Result<(), Refusal>

VBA DefineMacro: (defmacro (name params... [& rest]) ["doc"] template...).

Source

pub fn expand(&mut self, d: &Form, depth: u32) -> Result<Form, Refusal>

VBA ExpandMacros: a form to its fixpoint.

Source

pub fn expand_one_pass(&mut self, d: &Form) -> Result<Form, Refusal>

VBA ExpandOnePass: top-down; a list whose head is a macro is replaced by its substitution and not walked further.

Source

pub fn collect(&mut self, forms: Vec<Form>) -> Result<Vec<Form>, Refusal>

VlaTranspile’s and VlaExpandText’s pass 1 over the prelude and the source read together: every defmacro is defined, in order, and the other forms come back as the body.

Trait Implementations§

Source§

impl Default for Expander

Source§

fn default() -> Expander

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.