mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-13 15:18:28 +00:00
Invert quote-style when generating code within f-strings (#4487)
This commit is contained in:
parent
2fb312bb2b
commit
73efbeb581
49 changed files with 271 additions and 162 deletions
|
@ -336,6 +336,11 @@ impl<'a> Context<'a> {
|
|||
Some(self.stmts[parent_id])
|
||||
}
|
||||
|
||||
/// Return the current `Expr`.
|
||||
pub fn expr(&self) -> Option<&'a Expr> {
|
||||
self.exprs.iter().last().copied()
|
||||
}
|
||||
|
||||
/// Return the parent `Expr` of the current `Expr`.
|
||||
pub fn expr_parent(&self) -> Option<&'a Expr> {
|
||||
self.exprs.iter().rev().nth(1).copied()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue