Introduce Token element (#7048)

This commit is contained in:
Micha Reiser 2023-09-02 10:05:47 +02:00 committed by GitHub
parent 2f3a950f6f
commit c05e4628b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
78 changed files with 733 additions and 723 deletions

View file

@ -27,7 +27,7 @@ impl FormatNodeRule<StmtAssign> for FormatStmtAssign {
[
first.format(),
space(),
text("="),
token("="),
space(),
FormatTargets { targets: rest }
]
@ -89,9 +89,9 @@ impl Format<PyFormatContext<'_>> for FormatTargets<'_> {
write!(
f,
[
if_group_breaks(&text("(")),
if_group_breaks(&token("(")),
soft_block_indent(&first.format().with_options(Parentheses::Never)),
if_group_breaks(&text(")"))
if_group_breaks(&token(")"))
]
)
}
@ -103,7 +103,7 @@ impl Format<PyFormatContext<'_>> for FormatTargets<'_> {
[group(&format_args![
format_first,
space(),
text("="),
token("="),
space(),
FormatTargets { targets: rest }
])