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.
This commit is contained in:
parent
3358629dd1
commit
ccf6394d9f
1 changed files with 2 additions and 0 deletions
|
@ -240,6 +240,7 @@ impl<'a> Parser<StrInput<'a>> {
|
||||||
/// Create a new instance of a parser from a &str.
|
/// Create a new instance of a parser from a &str.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn new_from_str(value: &'a str) -> Self {
|
pub fn new_from_str(value: &'a str) -> Self {
|
||||||
|
debug_print!("\x1B[;31m>>>>>>>>>> New parser from str\x1B[;0m");
|
||||||
Parser::new(StrInput::new(value))
|
Parser::new(StrInput::new(value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,6 +252,7 @@ where
|
||||||
/// Create a new instance of a parser from an iterator of `char`s.
|
/// Create a new instance of a parser from an iterator of `char`s.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn new_from_iter(iter: T) -> Self {
|
pub fn new_from_iter(iter: T) -> Self {
|
||||||
|
debug_print!("\x1B[;31m>>>>>>>>>> New parser from iter\x1B[;0m");
|
||||||
Parser::new(BufferedInput::new(iter))
|
Parser::new(BufferedInput::new(iter))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue