mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-01 13:34:15 +00:00
Adjust parens around patterns in annotations
This commit is contained in:
parent
b79d387b46
commit
84b3969648
23 changed files with 88 additions and 128 deletions
|
|
@ -1,4 +1,4 @@
|
|||
UserId x : [UserId I64]
|
||||
UserId x = UserId 42
|
||||
(UserId x) = UserId 42
|
||||
|
||||
x
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
Email str = Email "blah@example.com"
|
||||
(Email str) = Email "blah@example.com"
|
||||
str
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
expect
|
||||
html : Html {}
|
||||
html =
|
||||
Element "a" 43 [HtmlAttr "href" "https://www.roc-lang.org/"] [Text "Roc"]
|
||||
|
||||
actual : { nodes : List RenderedNode, siblingIds : List U64 }
|
||||
actual =
|
||||
indexNodes { nodes: [], siblingIds: [] } html
|
||||
|
||||
expected : { nodes : List RenderedNode, siblingIds : List U64 }
|
||||
expected = {
|
||||
|
||||
nodes: [
|
||||
RenderedText "Roc",
|
||||
RenderedElement "a" { emptyRenderedAttrs & htmlAttrs: Dict.fromList [("href", "https://www.roc-lang.org/")] } [0],
|
||||
],
|
||||
|
||||
siblingIds: [1],
|
||||
}
|
||||
|
||||
(actual.nodes == expected.nodes)
|
||||
&& (actual.siblingIds == expected.siblingIds)
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
MT q = g
|
||||
(MT q) = g
|
||||
q
|
||||
dbgT
|
||||
|
|
@ -1,66 +1,34 @@
|
|||
{
|
||||
|
||||
u8: 123u8,
|
||||
|
||||
u16: 123u16,
|
||||
|
||||
u32: 123u32,
|
||||
|
||||
u64: 123u64,
|
||||
|
||||
u128: 123u128,
|
||||
|
||||
i8: 123i8,
|
||||
|
||||
i16: 123i16,
|
||||
|
||||
i32: 123i32,
|
||||
|
||||
i64: 123i64,
|
||||
|
||||
i128: 123i128,
|
||||
|
||||
dec: 123dec,
|
||||
|
||||
u8Neg: -123u8,
|
||||
|
||||
u16Neg: -123u16,
|
||||
|
||||
u32Neg: -123u32,
|
||||
|
||||
u64Neg: -123u64,
|
||||
|
||||
u128Neg: -123u128,
|
||||
|
||||
i8Neg: -123i8,
|
||||
|
||||
i16Neg: -123i16,
|
||||
|
||||
i32Neg: -123i32,
|
||||
|
||||
i64Neg: -123i64,
|
||||
|
||||
i128Neg: -123i128,
|
||||
|
||||
decNeg: -123dec,
|
||||
|
||||
u8Bin: 0b101u8,
|
||||
|
||||
u16Bin: 0b101u16,
|
||||
|
||||
u32Bin: 0b101u32,
|
||||
|
||||
u64Bin: 0b101u64,
|
||||
|
||||
u128Bin: 0b101u128,
|
||||
|
||||
i8Bin: 0b101i8,
|
||||
|
||||
i16Bin: 0b101i16,
|
||||
|
||||
i32Bin: 0b101i32,
|
||||
|
||||
i64Bin: 0b101i64,
|
||||
|
||||
i128Bin: 0b101i128,
|
||||
}
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
@Thunk it = id (@A {})
|
||||
(@Thunk it) = id (@A {})
|
||||
it {}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
x = foo
|
||||
(
|
||||
baz {
|
||||
|
||||
bar: blah,
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
x = foo {
|
||||
|
||||
bar
|
||||
: blah,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
x = foo {
|
||||
|
||||
bar: blah,
|
||||
}
|
||||
x
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
{ Foo.Bar.baz <-
|
||||
|
||||
x: 5,
|
||||
|
||||
y: 0,
|
||||
}
|
||||
|
|
@ -1,10 +1,6 @@
|
|||
{ Foo.Bar.baz <-
|
||||
|
||||
x: 5,
|
||||
|
||||
y: 0,
|
||||
|
||||
_z: 3,
|
||||
|
||||
_: 2,
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{ #
|
||||
|
||||
{
|
||||
#
|
||||
a,
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
|
||||
#
|
||||
}
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
{
|
||||
|
||||
answer: 42,
|
||||
|
||||
launchTheNukes!: \{} -> boom,
|
||||
}
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
|
||||
t,
|
||||
#
|
||||
}
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
Config launchTheNukes! code = cfg
|
||||
(Config launchTheNukes! code) = cfg
|
||||
|
||||
launchTheNukes! code
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
Config launchTheNukes! code = cfg
|
||||
(Config launchTheNukes! code) = cfg
|
||||
|
||||
launchTheNukes! code
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
Pair x _ = Pair 0 1
|
||||
Pair _ y = Pair 0 1
|
||||
Pair _ _ = Pair 0 1
|
||||
(Pair x _) = Pair 0 1
|
||||
(Pair _ y) = Pair 0 1
|
||||
(Pair _ _) = Pair 0 1
|
||||
_ = Pair 0 1
|
||||
Pair (Pair x _) (Pair _ y) = Pair (Pair 0 1) (Pair 2 3)
|
||||
(Pair (Pair x _) (Pair _ y)) = Pair (Pair 0 1) (Pair 2 3)
|
||||
|
||||
0
|
||||
|
|
@ -2144,40 +2144,6 @@ mod test_fmt {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn comments_with_newlines_in_records() {
|
||||
expr_formats_to(
|
||||
indoc!(
|
||||
r"
|
||||
{
|
||||
z: 44 #comment 0
|
||||
,
|
||||
y: 41, # comment 1
|
||||
|
||||
# comment 2
|
||||
x: 42
|
||||
|
||||
# comment 3
|
||||
|
||||
# comment 4
|
||||
}"
|
||||
),
|
||||
indoc!(
|
||||
r"
|
||||
{
|
||||
z: 44,
|
||||
# comment 0
|
||||
y: 41,
|
||||
# comment 1
|
||||
# comment 2
|
||||
x: 42,
|
||||
# comment 3
|
||||
# comment 4
|
||||
}"
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn multiple_final_comments_with_comma_in_records() {
|
||||
expr_formats_to(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue