Mercurial > python-compiler.rs
diff src/ast_convert.rs @ 49:141f1769e1f0
Add ast.Pass.
author | Bastien Orivel <eijebong@bananium.fr> |
---|---|
date | Wed, 08 Jun 2016 17:18:28 +0200 |
parents | 039f85b187f2 |
children | 5edbc24b625f |
line wrap: on
line diff
--- a/src/ast_convert.rs +++ b/src/ast_convert.rs @@ -441,6 +441,7 @@ fn parse_statement(py: Python, ast: PyOb let expr_type = ast_module.get(py, "Expr").unwrap(); let break_type = ast_module.get(py, "Break").unwrap(); let delete_type = ast_module.get(py, "Delete").unwrap(); + let pass_type = ast_module.get(py, "Pass").unwrap(); assert!(is_instance(&ast, &ast_type)); @@ -574,6 +575,8 @@ fn parse_statement(py: Python, ast: PyOb let targets = ast.getattr(py, "targets").unwrap(); let targets = parse_list(py, targets, parse_expr); stmt::Delete(targets) + } else if is_instance(&ast, &pass_type) { + stmt::Pass } else { println!("stmt {}", ast); panic!()