diff --git a/crates/reporting/src/error/parse.rs b/crates/reporting/src/error/parse.rs index 2631bdf1f5..c4b03f8623 100644 --- a/crates/reporting/src/error/parse.rs +++ b/crates/reporting/src/error/parse.rs @@ -3515,6 +3515,31 @@ fn to_provides_report<'a>( EProvides::Space(error, pos) => to_space_report(alloc, lines, filename, &error, pos), + EProvides::IndentTo(pos) => { + let surroundings = Region::new(start, pos); + let region = LineColumnRegion::from_pos(lines.convert_pos(pos)); + + let doc = alloc.stack([ + alloc.reflow(r"I am partway through parsing a header, but I got stuck here:"), + alloc.region_with_subregion(lines.convert_region(surroundings), region), + alloc.concat([ + alloc.reflow("I am expecting the "), + alloc.keyword("to"), + alloc.reflow(" keyword next, like"), + ]), + alloc + .parser_suggestion("to pf") + .indent(4), + ]); + + Report { + filename, + doc, + title: "WEIRD PROVIDES".to_string(), + severity: Severity::RuntimeError, + } + } + _ => todo!("unhandled parse error {:?}", parse_problem), } }