Format while Statement (#4810)

This commit is contained in:
Micha Reiser 2023-06-05 10:24:00 +02:00 committed by GitHub
parent d1d06960f0
commit c65f47d7c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 555 additions and 145 deletions

View file

@ -25,7 +25,6 @@ impl<'a> PyFormatContext<'a> {
}
}
#[allow(unused)]
pub(crate) fn contents(&self) -> &'a str {
self.contents
}
@ -35,7 +34,6 @@ impl<'a> PyFormatContext<'a> {
Locator::new(self.contents)
}
#[allow(unused)]
pub(crate) fn set_node_level(&mut self, level: NodeLevel) {
self.node_level = level;
}
@ -44,7 +42,6 @@ impl<'a> PyFormatContext<'a> {
self.node_level
}
#[allow(unused)]
pub(crate) fn comments(&self) -> &Comments<'a> {
&self.comments
}
@ -80,11 +77,10 @@ pub(crate) enum NodeLevel {
#[default]
TopLevel,
/// Formatting nodes that are enclosed by a statement.
#[allow(unused)]
Statement,
/// Formatting the body statements of a [compound statement](https://docs.python.org/3/reference/compound_stmts.html#compound-statements)
/// (`if`, `while`, `match`, etc.).
CompoundStatement,
/// Formatting nodes that are enclosed in a parenthesized expression.
#[allow(unused)]
Parenthesized,
}