mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
parent
5f74e10d32
commit
ca5d084497
17 changed files with 369 additions and 25 deletions
|
@ -2086,6 +2086,27 @@ fn to_pattern_in_parens_report<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
PInParens::Empty(pos) => {
|
||||
let surroundings = Region::new(start, pos);
|
||||
let region = LineColumnRegion::from_pos(lines.convert_pos(pos));
|
||||
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow("I am partway through parsing a parenthesized pattern or tuple:"),
|
||||
alloc.region_with_subregion(lines.convert_region(surroundings), region),
|
||||
alloc.concat([
|
||||
alloc.reflow(r"I was expecting to see a pattern next."),
|
||||
alloc.reflow(r"Note, Roc doesn't use '()' as a null type."),
|
||||
]),
|
||||
]);
|
||||
|
||||
Report {
|
||||
filename,
|
||||
doc,
|
||||
title: "EMPTY PARENTHESES".to_string(),
|
||||
severity: Severity::RuntimeError,
|
||||
}
|
||||
}
|
||||
|
||||
PInParens::End(pos) => {
|
||||
let surroundings = Region::new(start, pos);
|
||||
let region = LineColumnRegion::from_pos(lines.convert_pos(pos));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue