Remove Stmt::TryStar (#6566)

## Summary

Instead, we set an `is_star` flag on `Stmt::Try`. This is similar to the
pattern we've migrated towards for `Stmt::For` (removing
`Stmt::AsyncFor`) and friends. While these are significant differences
for an interpreter, we tend to handle these cases identically or nearly
identically.

## Test Plan

`cargo test`
This commit is contained in:
Charlie Marsh 2023-08-14 13:39:44 -04:00 committed by GitHub
parent 09c8b17661
commit 96d310fbab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 70 additions and 489 deletions

View file

@ -952,6 +952,7 @@ TryStatement: ast::Stmt = {
handlers,
orelse,
finalbody,
is_star: false,
range: (location..end_location).into()
},
)
@ -965,12 +966,13 @@ TryStatement: ast::Stmt = {
.map(Ranged::end)
.or_else(|| handlers.last().map(Ranged::end))
.unwrap();
ast::Stmt::TryStar(
ast::StmtTryStar {
ast::Stmt::Try(
ast::StmtTry {
body,
handlers,
orelse,
finalbody,
is_star: true,
range: (location..end_location).into()
},
)
@ -985,6 +987,7 @@ TryStatement: ast::Stmt = {
handlers,
orelse,
finalbody,
is_star: false,
range: (location..end_location).into()
},
)