Implement except* syntax

This commit is contained in:
Charlie Marsh 2023-02-20 13:40:19 -05:00 committed by Jeong YunWon
parent fab9adcd48
commit 2a86dbd644
6 changed files with 1450 additions and 0 deletions

View file

@ -709,6 +709,12 @@ impl Compiler {
orelse,
finalbody,
} => self.compile_try_statement(body, handlers, orelse, finalbody)?,
TryStar {
body,
handlers,
orelse,
finalbody,
} => self.compile_try_star_statement(body, handlers, orelse, finalbody)?,
FunctionDef {
name,
args,
@ -1092,6 +1098,16 @@ impl Compiler {
Ok(())
}
fn compile_try_star_statement(
&mut self,
_body: &[ast::Stmt],
_handlers: &[ast::Excepthandler],
_orelse: &[ast::Stmt],
_finalbody: &[ast::Stmt],
) -> CompileResult<()> {
Err(self.error(CodegenErrorType::NotImplementedYet))
}
fn is_forbidden_arg_name(name: &str) -> bool {
is_forbidden_name(name)
}

View file

@ -809,6 +809,12 @@ impl SymbolTableBuilder {
handlers,
orelse,
finalbody,
}
| TryStar {
body,
handlers,
orelse,
finalbody,
} => {
self.scan_statements(body)?;
for handler in handlers {