mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Implement initial tuple syntax
This commit is contained in:
parent
9abed3472a
commit
1753c9cf5b
11 changed files with 152 additions and 52 deletions
|
@ -1007,6 +1007,26 @@ fn to_expr_in_parens_report<'a>(
|
|||
expr,
|
||||
pos,
|
||||
),
|
||||
EInParens::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 expression or tuple:"),
|
||||
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,
|
||||
}
|
||||
}
|
||||
EInParens::End(pos) | EInParens::IndentEnd(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