From c0f390ebc6f5cda486f908ecf80dd03ec010112e Mon Sep 17 00:00:00 2001 From: harupy Date: Sat, 24 Dec 2022 13:38:33 +0900 Subject: [PATCH] Fix IfExp location --- parser/python.lalrpop | 2 +- ..._parser__tests__parse_if_else_generator_comprehension.snap | 2 +- .../rustpython_parser__with__tests__with_statement.snap | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parser/python.lalrpop b/parser/python.lalrpop index f586f0a..85dea57 100644 --- a/parser/python.lalrpop +++ b/parser/python.lalrpop @@ -731,7 +731,7 @@ YieldExpr: ast::Expr = { }; Test: ast::Expr = { - > "if" > "else" > => ast::Expr { + > "if" > "else" > => ast::Expr { location, end_location: Some(end_location), custom: (), diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_else_generator_comprehension.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_else_generator_comprehension.snap index d9762f5..92b8587 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_else_generator_comprehension.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_if_else_generator_comprehension.snap @@ -18,7 +18,7 @@ Located { elt: Located { location: Location { row: 1, - column: 3, + column: 1, }, end_location: Some( Location { diff --git a/parser/src/snapshots/rustpython_parser__with__tests__with_statement.snap b/parser/src/snapshots/rustpython_parser__with__tests__with_statement.snap index 031d6d8..95ad6f6 100644 --- a/parser/src/snapshots/rustpython_parser__with__tests__with_statement.snap +++ b/parser/src/snapshots/rustpython_parser__with__tests__with_statement.snap @@ -343,7 +343,7 @@ expression: "parse_program(source, \"\").unwrap()" context_expr: Located { location: Location { row: 5, - column: 7, + column: 5, }, end_location: Some( Location { @@ -452,7 +452,7 @@ expression: "parse_program(source, \"\").unwrap()" context_expr: Located { location: Location { row: 6, - column: 7, + column: 5, }, end_location: Some( Location {