Skip to content

Commit

Permalink
Add ability to remove error listeners from parser
Browse files Browse the repository at this point in the history
  • Loading branch information
surdus authored and rrevenantt committed Jan 13, 2022
1 parent ec3ea26 commit 4eecc87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub trait Parser<'input>: Recognizer<'input> {
fn add_error_listener(&mut self, listener: Box<dyn ErrorListener<'input, Self>>)
where
Self: Sized;
fn remove_error_listeners(&mut self);
fn notify_error_listeners(
&self,
msg: String,
Expand Down Expand Up @@ -292,6 +293,8 @@ where
self.error_listeners.borrow_mut().push(listener)
}

fn remove_error_listeners(&mut self) { self.error_listeners.borrow_mut().clear(); }

fn notify_error_listeners(
&self,
msg: String,
Expand Down

0 comments on commit 4eecc87

Please sign in to comment.