Report ingested file annotation syntax error

This commit is contained in:
Agus Zubiaga 2024-05-05 17:45:37 -03:00
parent 56f12718f1
commit 520dc389f3
No known key found for this signature in database
2 changed files with 37 additions and 0 deletions

View file

@ -670,6 +670,9 @@ fn to_expr_report<'a>(
EExpr::Dbg(e_expect, _position) => {
to_dbg_or_expect_report(alloc, lines, filename, context, Node::Dbg, e_expect, start)
}
EExpr::Import(e_import, position) => {
to_import_report(alloc, lines, filename, e_import, *position)
}
EExpr::TrailingOperator(pos) => {
let surroundings = Region::new(start, *pos);
let region = LineColumnRegion::from_pos(lines.convert_pos(*pos));
@ -1439,6 +1442,21 @@ fn to_dbg_or_expect_report<'a>(
}
}
fn to_import_report<'a>(
alloc: &'a RocDocAllocator<'a>,
lines: &LineInfo,
filename: PathBuf,
parse_problem: &roc_parse::parser::EImport<'a>,
_start: Position,
) -> Report<'a> {
use roc_parse::parser::EImport::*;
match parse_problem {
Annotation(ann_problem, pos) => to_type_report(alloc, lines, filename, ann_problem, *pos),
_ => todo!(),
}
}
fn to_if_report<'a>(
alloc: &'a RocDocAllocator<'a>,
lines: &LineInfo,