mirror of
https://github.com/RGBCube/alejandra
synced 2025-08-01 21:17: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);
|
steps.push_back(crate::builder::Step::Pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
children.drain_comments_and_newlines(|element| match element {
|
children.drain_comment(|text| {
|
||||||
crate::children::DrainCommentOrNewline::Comment(text) => {
|
|
||||||
steps.push_back(crate::builder::Step::Comment(text));
|
steps.push_back(crate::builder::Step::Comment(text));
|
||||||
}
|
|
||||||
crate::children::DrainCommentOrNewline::Newline(_) => {}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if let rnix::SyntaxKind::TOKEN_COMMA
|
if let rnix::SyntaxKind::TOKEN_COMMA
|
||||||
|
|
|
@ -74,4 +74,43 @@
|
||||||
|
|
||||||
({ a ? null }: _)
|
({ 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*/ }: _)
|
||||||
|
|
||||||
|
({
|
||||||
|
/*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