diff --git a/src/parser.rs b/src/parser.rs index ac982c0..6309366 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -376,7 +376,6 @@ impl BaseParser if self.build_parse_trees { self.add_context_to_parse_tree() } - self.trigger_enter_rule_event(); } pub fn exit_rule(&mut self) { @@ -404,8 +403,10 @@ impl BaseParser } } - self.ctx = Some(new_ctx) + self.ctx = Some(new_ctx); } + + self.trigger_enter_rule_event(); } @@ -415,7 +416,6 @@ impl BaseParser localctx.set_start(self.input.lt(1).map(Token::to_owned)); //println!("{}",self.input.lt(1).map(Token::to_owned).unwrap()); self.ctx = Some(localctx); - self.trigger_enter_rule_event() } pub fn push_new_recursion_context(&mut self, localctx: Rc, state: isize, _rule_index: usize) {