comparison 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
comparison
equal deleted inserted replaced
67:8ce78e2ba48c 68:c59ad5ccd8a6
49 49
50 // Raise(expr? exc, expr? cause) 50 // Raise(expr? exc, expr? cause)
51 Raise(Option<expr>, Option<expr>), 51 Raise(Option<expr>, Option<expr>),
52 52
53 // Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody) 53 // Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)
54 //Try(Vec<stmt>, Vec<excepthandler>, Vec<stmt>, Vec<stmt>) 54 Try(Vec<stmt>, Vec<excepthandler>, Vec<stmt>, Vec<stmt>),
55 55
56 // Assert(expr test, expr? msg) 56 // Assert(expr test, expr? msg)
57 Assert(expr, Option<expr>), 57 Assert(expr, Option<expr>),
58 58
59 // Import(alias* names) 59 // Import(alias* names)
184 pub iter: expr, 184 pub iter: expr,
185 pub ifs: Vec<expr> 185 pub ifs: Vec<expr>
186 } 186 }
187 187
188 #[derive(Clone, Debug, PartialEq, Eq, Hash)] 188 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
189 pub enum excepthandler { 189 pub struct excepthandler {
190 ExceptHandler(Option<expr>, Option<String>, Vec<stmt>) 190 pub type_: Option<expr>,
191 pub name: Option<String>,
192 pub body: Vec<stmt>,
191 } 193 }
192 194
193 #[derive(Clone, Debug, PartialEq, Eq, Hash)] 195 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
194 pub struct arguments { 196 pub struct arguments {
195 pub args: Vec<arg>, 197 pub args: Vec<arg>,