mirror of
https://github.com/RGBCube/alejandra
synced 2025-08-01 04:57:44 +00:00
feat: no extra space in patterns
This commit is contained in:
parent
76e9af334d
commit
02e4ce14d9
4 changed files with 14 additions and 13 deletions
|
@ -153,8 +153,9 @@ pub fn rule(
|
||||||
// }
|
// }
|
||||||
let child = children.get_next().unwrap();
|
let child = children.get_next().unwrap();
|
||||||
steps.push_back(crate::builder::Step::Dedent);
|
steps.push_back(crate::builder::Step::Dedent);
|
||||||
if !has_comments_between_curly_b && items_count <= 1 {
|
if !has_comments_between_curly_b && items_count == 1 {
|
||||||
steps.push_back(crate::builder::Step::Whitespace);
|
steps.push_back(crate::builder::Step::Whitespace);
|
||||||
|
} else if !has_comments_between_curly_b && items_count == 0 {
|
||||||
} else {
|
} else {
|
||||||
if let rnix::SyntaxKind::NODE_PAT_ENTRY = last_kind {
|
if let rnix::SyntaxKind::NODE_PAT_ENTRY = last_kind {
|
||||||
steps.push_back(crate::builder::Step::Token(
|
steps.push_back(crate::builder::Step::Token(
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
d
|
d
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
{ }:
|
{}:
|
||||||
b:
|
b:
|
||||||
/*
|
/*
|
||||||
c
|
c
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
a:
|
a:
|
||||||
{ }:
|
{}:
|
||||||
/*
|
/*
|
||||||
c
|
c
|
||||||
*/
|
*/
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
a: b: c:
|
a: b: c:
|
||||||
{ }:
|
{}:
|
||||||
a: b: c:
|
a: b: c:
|
||||||
a
|
a
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
[
|
[
|
||||||
({ } @ a: _)
|
({} @ a: _)
|
||||||
(
|
(
|
||||||
{ } @
|
{} @
|
||||||
/**/
|
/**/
|
||||||
a:
|
a:
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
{ }
|
{}
|
||||||
/**/
|
/**/
|
||||||
@ a:
|
@ a:
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
{ }
|
{}
|
||||||
/**/
|
/**/
|
||||||
@
|
@
|
||||||
/**/
|
/**/
|
||||||
|
@ -21,17 +21,17 @@
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
|
|
||||||
(a @ { }: _)
|
(a @ {}: _)
|
||||||
(
|
(
|
||||||
a @
|
a @
|
||||||
/**/
|
/**/
|
||||||
{ }:
|
{}:
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
a
|
a
|
||||||
/**/
|
/**/
|
||||||
@ { }:
|
@ {}:
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
/**/
|
/**/
|
||||||
@
|
@
|
||||||
/**/
|
/**/
|
||||||
{ }:
|
{}:
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
@ inp:
|
@ inp:
|
||||||
_
|
_
|
||||||
)
|
)
|
||||||
({ }: _)
|
({}: _)
|
||||||
({ a }: _)
|
({ a }: _)
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue