minor cleanup

This commit is contained in:
Anton-4 2021-12-09 14:14:20 +01:00
parent 8c82025721
commit 64ccf8a870
4 changed files with 4 additions and 2 deletions

View File

@ -33,6 +33,7 @@ pub fn def_to_def2<'a>(
match parsed_def {
SpaceBefore(inner_def, comments) => {
// filter comments
if !comments.is_empty() && !all_newlines(comments) {
let inner_def = def_to_def2(arena, env, scope, inner_def, region);
@ -52,6 +53,7 @@ pub fn def_to_def2<'a>(
}
}
SpaceAfter(inner_def, comments) => {
// filter comments
if !comments.is_empty() && !all_newlines(comments) {
let inner_def = def_to_def2(arena, env, scope, inner_def, region);

View File

@ -671,7 +671,6 @@ pub fn expr_to_expr2<'a>(
);
}
bad_expr @ SpaceBefore(_, _) => {
// TODO no panic, move in Expr2::Comment
panic!(
"A SpaceBefore did not get removed during operator desugaring somehow: {:#?}",
bad_expr

1
cli_utils/Cargo.lock generated
View File

@ -2679,6 +2679,7 @@ dependencies = [
"roc_collections",
"roc_module",
"roc_mono",
"roc_reporting",
"roc_std",
]

View File

@ -1472,7 +1472,7 @@ pub mod test_ed_update {
// add newlines like the editor's formatting would add them
fn add_nls(lines: Vec<String>) -> Vec<String> {
let mut new_lines = lines;
//Two lines between TLD's, extra newline so the user can go to third line add new def there
new_lines.append(&mut vec!["".to_owned(), "".to_owned(), "".to_owned()]);
new_lines