mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-21 07:49:17 +03:00
minor cleanup
This commit is contained in:
parent
8c82025721
commit
64ccf8a870
@ -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);
|
||||
|
||||
|
@ -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
1
cli_utils/Cargo.lock
generated
@ -2679,6 +2679,7 @@ dependencies = [
|
||||
"roc_collections",
|
||||
"roc_module",
|
||||
"roc_mono",
|
||||
"roc_reporting",
|
||||
"roc_std",
|
||||
]
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user