mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
Upgrade RustPython
to access ranged names (#5194)
## Summary In https://github.com/astral-sh/RustPython-Parser/pull/8, we modified RustPython to include ranges for any identifiers that aren't `Expr::Name` (which already has an identifier). For example, the `e` in `except ValueError as e` was previously un-ranged. To extract its range, we had to do some lexing of our own. This change should improve performance and let us remove a bunch of code. ## Test Plan `cargo test`
This commit is contained in:
parent
17f1ecd56e
commit
6331598511
24 changed files with 86 additions and 57 deletions
|
@ -1191,7 +1191,7 @@ impl<'a> Generator<'a> {
|
|||
self.p("*");
|
||||
self.unparse_expr(value, precedence::MAX);
|
||||
}
|
||||
Expr::Name(ast::ExprName { id, .. }) => self.p_id(id),
|
||||
Expr::Name(ast::ExprName { id, .. }) => self.p(id.as_str()),
|
||||
Expr::List(ast::ExprList { elts, .. }) => {
|
||||
self.p("[");
|
||||
let mut first = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue