Replace row/column based Location with byte-offsets. (#3931)

This commit is contained in:
Micha Reiser 2023-04-26 20:11:02 +02:00 committed by GitHub
parent ee91598835
commit cab65b25da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
418 changed files with 6203 additions and 7040 deletions

View file

@ -16,8 +16,12 @@ pub struct Args {
pub fn main(args: &Args) -> Result<()> {
let contents = fs::read_to_string(&args.file)?;
for (start, tok, end) in lexer::lex(&contents, Mode::Module).flatten() {
println!("{start:#?} {tok:#?} {end:#?}");
for (tok, range) in lexer::lex(&contents, Mode::Module).flatten() {
println!(
"{start:#?} {tok:#?} {end:#?}",
start = range.start(),
end = range.end()
);
}
Ok(())
}