mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Report ingested file annotation syntax error
This commit is contained in:
parent
56f12718f1
commit
520dc389f3
2 changed files with 37 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue