pub struct Preprocessor { /* private fields */ }Expand description
Preprocessor state.
Implementations§
Source§impl Preprocessor
impl Preprocessor
Sourcepub fn set_max_recursion_depth(&mut self, depth: usize)
pub fn set_max_recursion_depth(&mut self, depth: usize)
Set the maximum recursion depth for macro expansion.
Sourcepub fn set_max_iterations(&mut self, count: usize)
pub fn set_max_iterations(&mut self, count: usize)
Set the maximum total iteration count for .rept/.irp/.irpc.
Sourcepub fn define_symbol(&mut self, name: &str, value: i128)
pub fn define_symbol(&mut self, name: &str, value: i128)
Define a symbol for conditional assembly.
Sourcepub fn process<'a>(&mut self, source: &'a str) -> Result<Cow<'a, str>, AsmError>
pub fn process<'a>(&mut self, source: &'a str) -> Result<Cow<'a, str>, AsmError>
Process source text, expanding all preprocessor directives.
Returns the expanded source text ready for lexing/parsing. When no preprocessor directives are present and no macros are defined, returns a borrowed reference to the original source (zero allocation).
§Errors
Returns AsmError on malformed directives, recursion limit, or
iteration limit exceeded.
Trait Implementations§
Source§impl Debug for Preprocessor
impl Debug for Preprocessor
Auto Trait Implementations§
impl Freeze for Preprocessor
impl RefUnwindSafe for Preprocessor
impl Send for Preprocessor
impl Sync for Preprocessor
impl Unpin for Preprocessor
impl UnwindSafe for Preprocessor
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