There's support for creating a Generator from a Stylist instance:
|
#[derive(Debug, Clone)] |
|
pub struct Stylist<'a> { |
|
source: &'a str, |
|
indentation: Indentation, |
|
quote: Quote, |
|
line_ending: OnceCell<LineEnding>, |
|
} |
|
impl<'a> From<&'a Stylist<'a>> for Generator<'a> { |
|
fn from(stylist: &'a Stylist<'a>) -> Self { |
|
Self { |
|
indent: stylist.indentation(), |
|
line_ending: stylist.line_ending(), |
|
buffer: String::new(), |
|
indent_depth: 0, |
|
num_newlines: 0, |
|
initial: true, |
|
} |
|
} |
|
} |
And while indentation and line_ending are being respected, quote is ignored:/
Motivation for issue: RustPython/RustPython#6124 (comment)
There's support for creating a
Generatorfrom aStylistinstance:ruff/crates/ruff_python_codegen/src/stylist.rs
Lines 11 to 17 in 2a6dde4
ruff/crates/ruff_python_codegen/src/generator.rs
Lines 76 to 87 in 2a6dde4
And while
indentationandline_endingare being respected,quoteis ignored:/Motivation for issue: RustPython/RustPython#6124 (comment)