fix dbg!s and bash head on lexer

This commit is contained in:
TerraMaster85 2024-01-16 13:03:27 -05:00
parent 53eaf000a0
commit 82e43a271e
2 changed files with 4 additions and 3 deletions

View File

@ -15,7 +15,7 @@ pub fn lexer(text_source: &str) -> Result<Vec<Token>, Box<dyn Error>> {
};
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<Vec<Token>, Box<dyn Error>> {
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<Vec<Token>, Box<dyn Error>> {
&_ => {}
}
state.current_token.push(c);
dbg!("End", &c, &state);
}
Ok(state.lexed)

View File

@ -44,7 +44,7 @@ fn main() -> Result<(), Box<dyn Error>> {
Ok(lexed) => lexed,
};
dbg!("Lexed length {}", lexed.len());
dbg!(lexed.len());
Ok(())
}