Make lexeme and token logging more concise

This commit is contained in:
Juno Takano 2026-01-05 04:18:21 -03:00
commit 735b58866c
15 changed files with 229 additions and 20 deletions

View file

@ -34,6 +34,17 @@ impl Parseable for Span {
}
}
impl std::fmt::Display for Span {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
let display_open_state = match self.open {
Some(ref open_state) => {
if *open_state { "open" } else { "closed" }},
None => "unknown"
};
write!(f, "Span [{display_open_state}]")
}
}
#[cfg(test)]
mod tests {
use super::*;