pub struct ParseCtx {
pub errs: Vec<Spanned<Error>>,
/* private fields */
}Expand description
Compile parsed to executable filters.
This allows to go from a parsed filter to a filter executable by this crate.
Fields§
§errs: Vec<Spanned<Error>>errors occurred during transformation
Implementations§
Source§impl ParseCtx
impl ParseCtx
Sourcepub fn new(vars: Vec<String>) -> Self
pub fn new(vars: Vec<String>) -> Self
Initialise new context with list of global variables.
When running a filter produced by this context, values corresponding to the variables have to be supplied in the execution context.
Sourcepub fn insert_native(&mut self, name: String, arity: usize, f: Native)
pub fn insert_native(&mut self, name: String, arity: usize, f: Native)
Add a native filter with given name and arity.
Sourcepub fn insert_natives<I>(&mut self, natives: I)
pub fn insert_natives<I>(&mut self, natives: I)
Add native filters with given names and arities.
Sourcepub fn insert_defs(&mut self, defs: impl IntoIterator<Item = Def>)
pub fn insert_defs(&mut self, defs: impl IntoIterator<Item = Def>)
Import parsed definitions, such as obtained from the standard library.
Errors that might occur include undefined variables, for example.
Sourcepub fn root_def(&mut self, def: Def)
👎Deprecated since 1.1.0: use insert_defs instead
pub fn root_def(&mut self, def: Def)
insert_defs insteadInsert a root definition.
Sourcepub fn root_filter(&mut self, filter: Spanned<Filter>)
👎Deprecated since 1.1.0: this call has no effect
pub fn root_filter(&mut self, filter: Spanned<Filter>)
Insert a root filter.
Auto Trait Implementations§
impl Freeze for ParseCtx
impl RefUnwindSafe for ParseCtx
impl Send for ParseCtx
impl Sync for ParseCtx
impl Unpin for ParseCtx
impl UnwindSafe for ParseCtx
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