basic parsing

This commit is contained in:
Folkert 2021-04-14 13:03:31 +02:00
parent 063c039003
commit 64bc92c746
7 changed files with 140 additions and 20 deletions

View file

@ -3238,6 +3238,31 @@ fn to_requires_report<'a>(
ERequires::Space(error, row, col) => to_space_report(alloc, filename, &error, row, col),
ERequires::ListStart(row, col) => {
dbg!(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 am partway through parsing a header, but I got stuck here:"),
alloc.region_with_subregion(surroundings, region),
alloc.concat(vec![
alloc.reflow("I am expecting the "),
alloc.keyword("requires"),
alloc.reflow(" keyword next, like "),
]),
alloc
.parser_suggestion("requires { main : Task I64 Str }")
.indent(4),
]);
Report {
filename,
doc,
title: "MISSING REQUIRES".to_string(),
}
}
_ => todo!("unhandled parse error {:?}", parse_problem),
}
}