From 82e43a271ef5f41c0e9b9c6ec1a74c1d1ae20c40 Mon Sep 17 00:00:00 2001 From: TerraMaster85 Date: Tue, 16 Jan 2024 13:03:27 -0500 Subject: [PATCH] fix dbg!s and bash head on lexer --- kabel-rs/src/lexer.rs | 5 +++-- kabel-rs/src/main.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kabel-rs/src/lexer.rs b/kabel-rs/src/lexer.rs index fdec5b8..31710fa 100644 --- a/kabel-rs/src/lexer.rs +++ b/kabel-rs/src/lexer.rs @@ -15,7 +15,7 @@ pub fn lexer(text_source: &str) -> Result, Box> { }; for (i, c) in text_source.chars().enumerate() { - dbg!("{} into {}", &c, &state); + dbg!("Begin", &c, &state); // Commenting end if state.commenting && c == '\n' { @@ -104,7 +104,7 @@ pub fn lexer(text_source: &str) -> Result, Box> { state.current_token = String::new(); continue; } - "(" => { + "(" => {t w state.lexed.push(Token::Bracket(Bracket::Open)); state.current_token = String::new(); continue; @@ -149,6 +149,7 @@ pub fn lexer(text_source: &str) -> Result, Box> { &_ => {} } state.current_token.push(c); + dbg!("End", &c, &state); } Ok(state.lexed) diff --git a/kabel-rs/src/main.rs b/kabel-rs/src/main.rs index 45b5969..9697b6b 100644 --- a/kabel-rs/src/main.rs +++ b/kabel-rs/src/main.rs @@ -44,7 +44,7 @@ fn main() -> Result<(), Box> { Ok(lexed) => lexed, }; - dbg!("Lexed length {}", lexed.len()); + dbg!(lexed.len()); Ok(()) }