all is working again

This commit is contained in:
Folkert 2021-03-13 22:36:44 +01:00
parent 022ed7b24c
commit c26fd45d54
6 changed files with 191 additions and 113 deletions

View file

@ -125,6 +125,22 @@ fn to_syntax_report<'a>(
report(doc)
}
NotEndOfFile(row, col) => {
let surroundings = Region::from_rows_cols(start_row, start_col, *row, *col);
let region = Region::from_row_col(*row, *col);
let doc = alloc.stack(vec![
alloc.reflow(r"I expected to reach the end of the file, but got stuck here:"),
alloc.region_with_subregion(surroundings, region),
alloc.concat(vec![alloc.reflow("no hints")]),
]);
Report {
filename,
doc,
title: "NOT END OF FILE".to_string(),
}
}
SyntaxError::Eof(region) => {
let doc = alloc.stack(vec![alloc.reflow("End of Field"), alloc.region(*region)]);