diff src/python_ast.rs @ 68:c59ad5ccd8a6

Add ast.Try
author Bastien Orivel <eijebong@bananium.fr>
date Mon, 13 Jun 2016 03:03:13 +0200
parents 32550e12aedf
children a73eaf42bea1
line wrap: on
line diff
--- a/src/python_ast.rs
+++ b/src/python_ast.rs
@@ -51,7 +51,7 @@ pub enum stmt {
     Raise(Option<expr>, Option<expr>),
 
     // Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)
-    //Try(Vec<stmt>, Vec<excepthandler>, Vec<stmt>, Vec<stmt>)
+    Try(Vec<stmt>, Vec<excepthandler>, Vec<stmt>, Vec<stmt>),
 
     // Assert(expr test, expr? msg)
     Assert(expr, Option<expr>),
@@ -186,8 +186,10 @@ pub struct comprehension {
 }
 
 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
-pub enum excepthandler {
-    ExceptHandler(Option<expr>, Option<String>, Vec<stmt>)
+pub struct excepthandler {
+    pub type_: Option<expr>,
+    pub name: Option<String>,
+    pub body: Vec<stmt>,
 }
 
 #[derive(Clone, Debug, PartialEq, Eq, Hash)]