From ccf6394d9f5ffeee59eba66b18ea1daec9f66132 Mon Sep 17 00:00:00 2001 From: Ethiraric Date: Sat, 19 Oct 2024 18:53:18 +0200 Subject: [PATCH] Add more debug prints. When running tests that involve 2 runs of the parser, one with the `StrInput` and another with the `BufferedInput`, the output of debug prints can be confusing as it's unclear where one parser ends parsing and the other starts. These 2 prints allow us to know when each is started and, if one errors but not the other, to know which did. --- parser/src/parser.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/parser/src/parser.rs b/parser/src/parser.rs index cf452da..9f45a85 100644 --- a/parser/src/parser.rs +++ b/parser/src/parser.rs @@ -240,6 +240,7 @@ impl<'a> Parser> { /// Create a new instance of a parser from a &str. #[must_use] pub fn new_from_str(value: &'a str) -> Self { + debug_print!("\x1B[;31m>>>>>>>>>> New parser from str\x1B[;0m"); Parser::new(StrInput::new(value)) } } @@ -251,6 +252,7 @@ where /// Create a new instance of a parser from an iterator of `char`s. #[must_use] pub fn new_from_iter(iter: T) -> Self { + debug_print!("\x1B[;31m>>>>>>>>>> New parser from iter\x1B[;0m"); Parser::new(BufferedInput::new(iter)) } }