mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-31 12:37:45 +00:00
fix: pattern comments
This commit is contained in:
parent
825b08bcb5
commit
4c1f4644ec
3 changed files with 105 additions and 5 deletions
|
@ -92,11 +92,8 @@ pub fn rule(
|
|||
steps.push_back(crate::builder::Step::Pad);
|
||||
}
|
||||
|
||||
children.drain_comments_and_newlines(|element| match element {
|
||||
crate::children::DrainCommentOrNewline::Comment(text) => {
|
||||
steps.push_back(crate::builder::Step::Comment(text));
|
||||
}
|
||||
crate::children::DrainCommentOrNewline::Newline(_) => {}
|
||||
children.drain_comment(|text| {
|
||||
steps.push_back(crate::builder::Step::Comment(text));
|
||||
});
|
||||
|
||||
if let rnix::SyntaxKind::TOKEN_COMMA
|
||||
|
|
|
@ -74,4 +74,43 @@
|
|||
|
||||
({ a ? null }: _)
|
||||
({ /*a*/ b /*a*/ ? /*a*/ null /*c*/ , /*d*/ e /*a*/ ? /*a*/ null /*f*/ , /*g*/ ... /*h*/ }: _)
|
||||
|
||||
({
|
||||
/*a*/
|
||||
#
|
||||
b
|
||||
/*a*/
|
||||
#
|
||||
?
|
||||
/*a*/
|
||||
#
|
||||
null
|
||||
/*c*/
|
||||
#
|
||||
,
|
||||
/*d*/
|
||||
#
|
||||
e
|
||||
/*a*/
|
||||
#
|
||||
?
|
||||
/*a*/
|
||||
#
|
||||
null
|
||||
/*f*/
|
||||
#
|
||||
,
|
||||
/*g*/
|
||||
#
|
||||
...
|
||||
/*h*/
|
||||
#
|
||||
}
|
||||
/*i*/
|
||||
#
|
||||
:
|
||||
/*j*/
|
||||
#
|
||||
_
|
||||
)
|
||||
]
|
||||
|
|
|
@ -1094,4 +1094,68 @@
|
|||
}:
|
||||
_
|
||||
)
|
||||
|
||||
(
|
||||
{
|
||||
/*
|
||||
a
|
||||
*/
|
||||
#
|
||||
b
|
||||
/*
|
||||
a
|
||||
*/
|
||||
#
|
||||
?
|
||||
/*
|
||||
a
|
||||
*/
|
||||
#
|
||||
null
|
||||
/*
|
||||
c
|
||||
*/
|
||||
#
|
||||
,
|
||||
/*
|
||||
d
|
||||
*/
|
||||
#
|
||||
e
|
||||
/*
|
||||
a
|
||||
*/
|
||||
#
|
||||
?
|
||||
/*
|
||||
a
|
||||
*/
|
||||
#
|
||||
null
|
||||
/*
|
||||
f
|
||||
*/
|
||||
#
|
||||
,
|
||||
/*
|
||||
g
|
||||
*/
|
||||
#
|
||||
...
|
||||
/*
|
||||
h
|
||||
*/
|
||||
#
|
||||
}
|
||||
/*
|
||||
i
|
||||
*/
|
||||
#
|
||||
:
|
||||
/*
|
||||
j
|
||||
*/
|
||||
#
|
||||
_
|
||||
)
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue