mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-31 12:37:45 +00:00
feat: get rec {
done right
This commit is contained in:
parent
d4decc99fa
commit
6a5f456d72
3 changed files with 15 additions and 3 deletions
|
@ -19,6 +19,14 @@ pub fn rule(
|
|||
build_ctx.config.layout()
|
||||
};
|
||||
|
||||
// rec
|
||||
let child = children.peek_next().unwrap();
|
||||
if let rnix::SyntaxKind::TOKEN_REC = child.element.kind() {
|
||||
steps.push_back(crate::builder::Step::Format(child.element));
|
||||
steps.push_back(crate::builder::Step::Whitespace);
|
||||
children.move_next();
|
||||
}
|
||||
|
||||
// {
|
||||
let child = children.get_next().unwrap();
|
||||
steps.push_back(crate::builder::Step::Format(child.element));
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
{/*a*/}
|
||||
{a=1;}
|
||||
{/*a*/b=1;/*c*/}
|
||||
{a={a={a={a={a={a={a={a={a={a={};};};};};};};};};};}
|
||||
{a=rec {a={a=rec {a={a=rec {a={a=rec {a={a=rec {a={};};};};};};};};};};}
|
||||
]
|
||||
|
|
|
@ -16,9 +16,13 @@
|
|||
*/
|
||||
}
|
||||
{
|
||||
a = {
|
||||
a = rec {
|
||||
a = {
|
||||
a = { a = { a = { a = { a = { a = { a = { a = { }; }; }; }; }; }; }; };
|
||||
a = rec {
|
||||
a = {
|
||||
a = rec { a = { a = rec { a = { a = rec { a = { }; }; }; }; }; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue