Mercurial > python-compiler.rs
diff src/ast_dump.rs @ 60:9f0f457a67f6
Add ast.Raise.
author | Bastien Orivel <eijebong@bananium.fr> |
---|---|
date | Mon, 13 Jun 2016 01:24:09 +0200 |
parents | 407b3b217928 |
children | d255a932553f |
line wrap: on
line diff
--- a/src/ast_dump.rs +++ b/src/ast_dump.rs @@ -296,6 +296,19 @@ impl stmt { }, statements_to_string(indent, body) ) + }, + stmt::Raise(exc, cause) => { + format!("{}raise{}{}", + current_indent, + match exc { + None => String::new(), + Some(ref exc) => format!(" {}", exc.to_string()) + }, + match cause { + None => String::new(), + Some(ref cause) => format!(" from {}", cause.to_string()) + } + ) } } }