mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Merge pull request #4567 from joshuawarner32/tuple-type-annotation
Implement tuple type parsing
This commit is contained in:
commit
848c18f996
22 changed files with 721 additions and 69 deletions
|
@ -2907,6 +2907,27 @@ fn to_tinparens_report<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
ETypeInParens::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 type:"),
|
||||
alloc.region_with_subregion(lines.convert_region(surroundings), region),
|
||||
alloc.concat([
|
||||
alloc.reflow(r"I was expecting to see an expression next."),
|
||||
alloc.reflow(r"Note, Roc doesn't use '()' as a null type."),
|
||||
]),
|
||||
]);
|
||||
|
||||
Report {
|
||||
filename,
|
||||
doc,
|
||||
title: "EMPTY PARENTHESES".to_string(),
|
||||
severity: Severity::RuntimeError,
|
||||
}
|
||||
}
|
||||
|
||||
ETypeInParens::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