mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
minor improvements
This commit is contained in:
parent
3e41f6eb5a
commit
f0795e6935
3 changed files with 10 additions and 15 deletions
|
@ -49,7 +49,6 @@ impl Progress {
|
|||
pub enum SyntaxError<'a> {
|
||||
Unexpected(Region),
|
||||
OutdentedTooFar,
|
||||
TooManyLines,
|
||||
Eof(Region),
|
||||
InvalidPattern,
|
||||
BadUtf8,
|
||||
|
@ -266,10 +265,6 @@ pub enum BadInputError {
|
|||
HasTab,
|
||||
HasMisplacedCarriageReturn,
|
||||
HasAsciiControl,
|
||||
///
|
||||
TooManyLines,
|
||||
///
|
||||
///
|
||||
BadUtf8,
|
||||
}
|
||||
|
||||
|
|
|
@ -3858,9 +3858,9 @@ fn to_space_report<'a>(
|
|||
let region = LineColumnRegion::from_pos(lines.convert_pos(pos));
|
||||
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow("I encountered a tab character"),
|
||||
alloc.reflow("I encountered a tab character:"),
|
||||
alloc.region(region),
|
||||
alloc.reflow("Tab characters are not allowed."),
|
||||
alloc.reflow("Tab characters are not allowed, use spaces instead."),
|
||||
]);
|
||||
|
||||
Report {
|
||||
|
@ -3875,7 +3875,7 @@ fn to_space_report<'a>(
|
|||
let region = LineColumnRegion::from_pos(lines.convert_pos(pos));
|
||||
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow("I encountered an ASCII control character"),
|
||||
alloc.reflow("I encountered an ASCII control character:"),
|
||||
alloc.region(region),
|
||||
alloc.reflow("ASCII control characters are not allowed."),
|
||||
]);
|
||||
|
@ -3892,7 +3892,7 @@ fn to_space_report<'a>(
|
|||
let region = LineColumnRegion::from_pos(lines.convert_pos(pos));
|
||||
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow(r"I encountered a carriage return (\r)"),
|
||||
alloc.reflow(r"I encountered a stray carriage return (\r):"),
|
||||
alloc.region(region),
|
||||
alloc.reflow(r"A carriage return (\r) has to be followed by a newline (\n)."),
|
||||
]);
|
||||
|
|
|
@ -4535,12 +4535,12 @@ mod test_reporting {
|
|||
@r###"
|
||||
── TAB CHARACTER ──────────────────────────────── tmp/record_type_tab/Test.roc ─
|
||||
|
||||
I encountered a tab character
|
||||
I encountered a tab character:
|
||||
|
||||
4│ f : { foo }
|
||||
^
|
||||
|
||||
Tab characters are not allowed.
|
||||
Tab characters are not allowed, use spaces instead.
|
||||
"###
|
||||
);
|
||||
|
||||
|
@ -4550,12 +4550,12 @@ mod test_reporting {
|
|||
@r###"
|
||||
── TAB CHARACTER ─────────────────────────────── tmp/comment_with_tab/Test.roc ─
|
||||
|
||||
I encountered a tab character
|
||||
I encountered a tab character:
|
||||
|
||||
4│ # comment with a
|
||||
^
|
||||
|
||||
Tab characters are not allowed.
|
||||
Tab characters are not allowed, use spaces instead.
|
||||
"###
|
||||
);
|
||||
|
||||
|
@ -4565,7 +4565,7 @@ mod test_reporting {
|
|||
@r###"
|
||||
── ASII CONTROL CHARACTER ──────── tmp/comment_with_control_character/Test.roc ─
|
||||
|
||||
I encountered an ASCII control character
|
||||
I encountered an ASCII control character:
|
||||
|
||||
4│ # comment with a
|
||||
^
|
||||
|
@ -4580,7 +4580,7 @@ mod test_reporting {
|
|||
@r###"
|
||||
── MISPLACED CARRIAGE RETURN ──────── tmp/record_type_carriage_return/Test.roc ─
|
||||
|
||||
I encountered a carriage return (\r)
|
||||
I encountered a stray carriage return (\r):
|
||||
|
||||
4│ f : { foo }
|
||||
^
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue