mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-01 21:40:58 +00:00
Merge branch 'main' into fix-deprecated-interpolated-formatting
This commit is contained in:
commit
ca037c5d0e
44 changed files with 4321 additions and 127 deletions
|
|
@ -38,7 +38,9 @@ Defs(
|
|||
},
|
||||
],
|
||||
},
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @28-31 Identifier {
|
||||
ident: "foo",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ Defs(
|
|||
},
|
||||
],
|
||||
},
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @29-32 Identifier {
|
||||
ident: "foo",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ SpaceAfter(
|
|||
"Foo",
|
||||
[],
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @15-23 RecordDestructure(
|
||||
[
|
||||
@17-18 Identifier {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,9 @@ SpaceAfter(
|
|||
},
|
||||
],
|
||||
},
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @26-34 Apply(
|
||||
@26-32 Tag(
|
||||
"UserId",
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ SpaceAfter(
|
|||
"Foo",
|
||||
[],
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @15-23 Tuple(
|
||||
[
|
||||
@17-18 Identifier {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,9 @@ Defs {
|
|||
},
|
||||
],
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @30-34 Identifier {
|
||||
ident: "html",
|
||||
},
|
||||
|
|
@ -166,7 +168,9 @@ Defs {
|
|||
],
|
||||
ext: None,
|
||||
},
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @190-196 Identifier {
|
||||
ident: "actual",
|
||||
},
|
||||
|
|
@ -246,7 +250,9 @@ Defs {
|
|||
],
|
||||
ext: None,
|
||||
},
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @326-334 Identifier {
|
||||
ident: "expected",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ Defs(
|
|||
[],
|
||||
),
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @45-50 Identifier {
|
||||
ident: "table",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ SpaceAfter(
|
|||
),
|
||||
},
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @21-22 Identifier {
|
||||
ident: "f",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ SpaceAfter(
|
|||
ext: None,
|
||||
},
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @22-23 Identifier {
|
||||
ident: "f",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ Defs {
|
|||
[],
|
||||
),
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @43-55 Identifier {
|
||||
ident: "wrappedNotEq",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -53,7 +53,9 @@ Defs(
|
|||
ext: None,
|
||||
},
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @28-29 Identifier {
|
||||
ident: "f",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -61,7 +61,9 @@ Defs(
|
|||
),
|
||||
},
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @30-31 Identifier {
|
||||
ident: "f",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ Defs(
|
|||
"Int",
|
||||
[],
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @10-13 Identifier {
|
||||
ident: "foo",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ Defs(
|
|||
[],
|
||||
),
|
||||
),
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @25-28 Identifier {
|
||||
ident: "foo",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ SpaceAfter(
|
|||
],
|
||||
ext: None,
|
||||
},
|
||||
comment: None,
|
||||
lines_between: [
|
||||
Newline,
|
||||
],
|
||||
body_pattern: @21-26 Identifier {
|
||||
ident: "where",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6231,13 +6231,108 @@ mod test_fmt {
|
|||
[first as last]
|
||||
| [first, last] ->
|
||||
first
|
||||
|
||||
|
||||
_ -> Not
|
||||
"
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body() {
|
||||
expr_formats_same(indoc!(
|
||||
r"
|
||||
x : i32
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body_comment() {
|
||||
expr_formats_same(indoc!(
|
||||
r"
|
||||
x : i32 # comment
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body_comments() {
|
||||
expr_formats_same(indoc!(
|
||||
r"
|
||||
x : i32
|
||||
# comment
|
||||
# comment 2
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body_comments_without_newlines() {
|
||||
expr_formats_to(
|
||||
indoc!(
|
||||
r"
|
||||
x : i32
|
||||
|
||||
# comment
|
||||
|
||||
# comment 2
|
||||
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
),
|
||||
indoc!(
|
||||
r"
|
||||
x : i32
|
||||
# comment
|
||||
# comment 2
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body_blank_comment() {
|
||||
expr_formats_same(indoc!(
|
||||
r"
|
||||
x : i32
|
||||
#
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserve_annotated_body_without_newlines() {
|
||||
expr_formats_to(
|
||||
indoc!(
|
||||
r"
|
||||
x : i32
|
||||
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
),
|
||||
indoc!(
|
||||
r"
|
||||
x : i32
|
||||
x = 1
|
||||
x
|
||||
"
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// this is a parse error atm
|
||||
// #[test]
|
||||
// fn multiline_apply() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue