MCPcopy Create free account
hub / github.com/amber-lang/heraclitus / parse_debug

Method parse_debug

src/compiling/parser/syntax_module.rs:70–90  ·  view source on GitHub ↗

Do not implement this function as this is a predefined function for debugging

(&mut self, meta: &mut M)

Source from the content-addressed store, hash-verified

68 fn parse(&mut self, meta: &mut M) -> SyntaxResult;
69 /// Do not implement this function as this is a predefined function for debugging
70 fn parse_debug(&mut self, meta: &mut M) -> SyntaxResult {
71 match meta.get_debug() {
72 Some(debug) => {
73 let padding = " ".repeat(debug);
74 println!("{padding}[Entered] {}", Self::name());
75 meta.set_debug(debug + 1);
76 let time = std::time::Instant::now();
77 let result = self.parse(meta);
78 match result {
79 Ok(()) => println!("{padding}{} {} ({}ms)", "[Left]".green(), Self::name(), time.elapsed().as_millis()),
80 Err(_) => println!("{padding}{} {} ({}ms)", "[Failed]".red(), Self::name(), time.elapsed().as_millis())
81 }
82 meta.set_debug(debug);
83 result
84 }
85 None => {
86 meta.set_debug(0);
87 self.parse_debug(meta)
88 }
89 }
90 }
91}
92
93#[cfg(test)]

Callers 2

compileMethod · 0.80
syntaxFunction · 0.80

Implementers 8

syntax_module.rssrc/compiling/parser/syntax_module.rs
number.rstests/arith_modules/number.rs
add.rstests/arith_modules/add.rs
expr.rstests/arith_modules/expr.rs
if_statement.rstests/cobra_modules/if_statement.rs
text.rstests/cobra_modules/text.rs
block.rstests/cobra_modules/block.rs
expr.rstests/cobra_modules/expr.rs

Calls 3

get_debugMethod · 0.80
set_debugMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected