MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / enter_every_rule

Method enter_every_rule

cel/src/parser/parser.rs:410–425  ·  view source on GitHub ↗
(
        &mut self,
        ctx: &<CELParserContextType as ParserNodeType>::Type,
    )

Source from the content-addressed store, hash-verified

408
409impl<'a> ParseTreeListener<'a, CELParserContextType> for RecursionListener {
410 fn enter_every_rule(
411 &mut self,
412 ctx: &<CELParserContextType as ParserNodeType>::Type,
413 ) -> Result<(), ANTLRError> {
414 if self.depth > self.max || self.depth == u16::MAX {
415 let pos = (ctx.start().get_start(), ctx.stop().get_stop());
416 return Err(ANTLRError::OtherError(Arc::new(ParseError {
417 source: None,
418 pos,
419 msg: format!("Recursion limit of {} exceeded", self.max),
420 expr_id: 0,
421 source_info: None,
422 })));
423 }
424 Ok(())
425 }
426
427 fn exit_every_rule(
428 &mut self,

Callers 1

enterMethod · 0.80

Calls 1

startMethod · 0.80

Tested by

no test coverage detected