fix dbg!s and bash head on lexer
This commit is contained in:
parent
53eaf000a0
commit
82e43a271e
|
@ -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)
|
||||
|
|
|
@ -44,7 +44,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
Ok(lexed) => lexed,
|
||||
};
|
||||
|
||||
dbg!("Lexed length {}", lexed.len());
|
||||
dbg!(lexed.len());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue