pub struct NotationEnv {
pub scopes: Vec<Vec<NotationRule>>,
}Expand description
A notation environment with scoped rules.
Fields§
§scopes: Vec<Vec<NotationRule>>Stack of scopes, outermost first
Implementations§
Source§impl NotationEnv
impl NotationEnv
Sourcepub fn push_scope(&mut self)
pub fn push_scope(&mut self)
Push a new scope.
Sourcepub fn add(&mut self, rule: NotationRule)
pub fn add(&mut self, rule: NotationRule)
Add a rule to the current scope.
Sourcepub fn lookup(&self, pattern: &str) -> Vec<&NotationRule>
pub fn lookup(&self, pattern: &str) -> Vec<&NotationRule>
Look up all rules for a pattern (innermost scope first).
Sourcepub fn total_rules(&self) -> usize
pub fn total_rules(&self) -> usize
Total number of rules across all scopes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NotationEnv
impl RefUnwindSafe for NotationEnv
impl Send for NotationEnv
impl Sync for NotationEnv
impl Unpin for NotationEnv
impl UnsafeUnpin for NotationEnv
impl UnwindSafe for NotationEnv
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