mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-19 11:05:45 +00:00
Implement except* syntax
This commit is contained in:
parent
fab9adcd48
commit
2a86dbd644
6 changed files with 1450 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -809,6 +809,12 @@ impl SymbolTableBuilder {
|
|||
handlers,
|
||||
orelse,
|
||||
finalbody,
|
||||
}
|
||||
| TryStar {
|
||||
body,
|
||||
handlers,
|
||||
orelse,
|
||||
finalbody,
|
||||
} => {
|
||||
self.scan_statements(body)?;
|
||||
for handler in handlers {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue