From 165b9797338d9532cae81fc8c8ae3b0556286992 Mon Sep 17 00:00:00 2001 From: harupy Date: Mon, 12 Dec 2022 22:36:34 +0900 Subject: [PATCH] Refactor --- parser/python.lalrpop | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parser/python.lalrpop b/parser/python.lalrpop index 3c980b0..cca2a46 100644 --- a/parser/python.lalrpop +++ b/parser/python.lalrpop @@ -439,7 +439,8 @@ TryStatement: ast::Stmt = { .last() .map(|last| last.end_location) .or_else(|| orelse.last().map(|last| last.end_location)) - .unwrap_or_else(|| handlers.last().unwrap().end_location); + .or_else(|| handlers.last().map(|last| last.end_location)) + .unwrap(); ast::Stmt { custom: (), location,