-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
questionAsking for support or clarificationAsking for support or clarification
Description
There's support for creating a Generator from a Stylist instance:
ruff/crates/ruff_python_codegen/src/stylist.rs
Lines 11 to 17 in 2a6dde4
| #[derive(Debug, Clone)] | |
| pub struct Stylist<'a> { | |
| source: &'a str, | |
| indentation: Indentation, | |
| quote: Quote, | |
| line_ending: OnceCell<LineEnding>, | |
| } |
ruff/crates/ruff_python_codegen/src/generator.rs
Lines 76 to 87 in 2a6dde4
| 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)
Metadata
Metadata
Assignees
Labels
questionAsking for support or clarificationAsking for support or clarification