pub struct MacroEngine<'a> {
pub spec: CommandSpec,
pub reading_macro: Vec<MacroNode<'a>>,
pub scanned_tokens: Vec<(Token, &'a str)>,
/* private fields */
}Expand description
MacroEngine has exact same interface as Lexer, but it expands macros.
When it meets a macro in token stream, It evaluates a macro into expanded tokens.
Fields§
§spec: CommandSpecCommand specification
reading_macro: Vec<MacroNode<'a>>Macro stack
scanned_tokens: Vec<(Token, &'a str)>Toekns used by macro stack
Implementations§
Source§impl<'a> MacroEngine<'a>
impl<'a> MacroEngine<'a>
Sourcepub fn new(spec: CommandSpec) -> Self
pub fn new(spec: CommandSpec) -> Self
Create a new macro engine
Sourcepub fn create_scope(&mut self) -> (Snapshot,)
pub fn create_scope(&mut self) -> (Snapshot,)
Create a new scope for macro definitions
Trait Implementations§
Source§impl<'a> MacroifyStream<'a> for MacroEngine<'a>
impl<'a> MacroifyStream<'a> for MacroEngine<'a>
Source§impl<'a> TokenStream<'a> for MacroEngine<'a>
impl<'a> TokenStream<'a> for MacroEngine<'a>
Auto Trait Implementations§
impl<'a> Freeze for MacroEngine<'a>
impl<'a> RefUnwindSafe for MacroEngine<'a>
impl<'a> Send for MacroEngine<'a>
impl<'a> Sync for MacroEngine<'a>
impl<'a> Unpin for MacroEngine<'a>
impl<'a> UnwindSafe for MacroEngine<'a>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.