port platform module

This commit is contained in:
Folkert 2021-03-09 22:00:00 +01:00
parent 3eddedc566
commit 25d7caa89e
3 changed files with 44 additions and 8 deletions

View file

@ -2552,6 +2552,27 @@ fn to_header_report<'a>(
}
}
EHeader::PlatformName(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 got stuck here:"),
alloc.region_with_subregion(surroundings, region),
alloc.concat(vec![
alloc.reflow("I am expecting a platform name next, like "),
alloc.parser_suggestion("roc/core"),
alloc.reflow("."),
]),
]);
Report {
filename,
doc,
title: "WEIRD MODULE NAME".to_string(),
}
}
EHeader::Space(error, row, col) => to_space_report(alloc, filename, &error, *row, *col),
}
}