Fix `TypeAliasName` to store name instead of load (#42)

Copies the fix in https://github.com/RustPython/Parser/pull/99
This commit is contained in:
Zanie Blue 2023-07-26 17:53:34 -05:00 committed by GitHub
parent fab9cc5294
commit 7ec979d022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1029,7 +1029,7 @@ FuncDef: ast::Stmt = {
TypeAliasName: ast::Expr = { TypeAliasName: ast::Expr = {
<location:@L> <name:Identifier> <end_location:@R> => ast::Expr::Name( <location:@L> <name:Identifier> <end_location:@R> => ast::Expr::Name(
ast::ExprName { id: name.into(), ctx: ast::ExprContext::Load, range: (location..end_location).into() }, ast::ExprName { id: name.into(), ctx: ast::ExprContext::Store, range: (location..end_location).into() },
), ),
} }

View File

@ -1,5 +1,5 @@
// auto-generated: "lalrpop 0.20.0" // auto-generated: "lalrpop 0.20.0"
// sha3: bfe8038efa3e290b9841ea2f84a2278ded65476a00892aa448e9708655ccb86d // sha3: 9c49dc85355275f274dcc32e163c443c0dc567214c9725547e2218e9acd22577
use num_bigint::BigInt; use num_bigint::BigInt;
use ruff_text_size::TextSize; use ruff_text_size::TextSize;
use ruff_python_ast::{self as ast, Ranged, MagicKind}; use ruff_python_ast::{self as ast, Ranged, MagicKind};
@ -33544,7 +33544,7 @@ fn __action163<
) -> ast::Expr ) -> ast::Expr
{ {
ast::Expr::Name( ast::Expr::Name(
ast::ExprName { id: name.into(), ctx: ast::ExprContext::Load, range: (location..end_location).into() }, ast::ExprName { id: name.into(), ctx: ast::ExprContext::Store, range: (location..end_location).into() },
) )
} }