diff --git a/source.c b/source.c index b8a5f3f..8dd4343 100644 --- a/source.c +++ b/source.c @@ -1 +1 @@ -int a = 2; \ No newline at end of file +*a=2; \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 035e52f..a59c7d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1446,12 +1446,14 @@ fn main() { let mut lexer = Lexer::new(&file_content); match lexer.lex() { Ok((tokens, tokens_location, errors)) => { - println!("Tokens: {:?}, location{:?}", tokens, tokens_location); + for (token, location) in tokens.iter().zip(tokens_location.iter()) { + println!("Tokens: {:?}, Location: {:?}", token, location); + } // 处理错误信息 for err in errors { eprintln!("Error: {}", err); } - } + } Err(err) => eprintln!("Error: {}", err), } }