mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-15 04:10:14 +03:00
Report lacking to
while parsing app header
This commit is contained in:
parent
d5511a57e1
commit
d141237a17
@ -3515,6 +3515,31 @@ fn to_provides_report<'a>(
|
|||||||
|
|
||||||
EProvides::Space(error, pos) => to_space_report(alloc, lines, filename, &error, pos),
|
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),
|
_ => todo!("unhandled parse error {:?}", parse_problem),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user