Skip to content

Commit 49b9f49

Browse files
committed
Fix NamedExpr location
1 parent 8cb2b82 commit 49b9f49

4 files changed

+10
-10
lines changed

compiler/parser/python.lalrpop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,10 @@ NamedExpressionTest: ast::Expr = {
767767
}
768768

769769
NamedExpression: ast::Expr = {
770-
<location:@L> <id:Identifier> ":=" <value:Test<"all">> <end_location:@R> => {
770+
<location:@L> <id:Identifier> <end_location:@R> ":=" <value:Test<"all">> => {
771771
ast::Expr {
772772
location,
773-
end_location: Some(end_location),
773+
end_location: value.end_location,
774774
custom: (),
775775
node: ast::ExprKind::NamedExpr {
776776
target: Box::new(ast::Expr::new(

compiler/parser/src/snapshots/rustpython_parser__context__tests__assign_named_expr.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__parser__tests__parse_named_expression_generator_comprehension.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__with__tests__with_statement.snap

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)