Mercurial > python-compiler.rs
diff src/ast_dump.rs @ 57:e5a808ec31c0
Add ast.Assert.
author | Bastien Orivel <eijebong@bananium.fr> |
---|---|
date | Sun, 12 Jun 2016 18:21:15 +0200 |
parents | c3cc16b933d2 |
children | a0b23123901b |
line wrap: on
line diff
--- a/src/ast_dump.rs +++ b/src/ast_dump.rs @@ -265,7 +265,19 @@ impl stmt { stmt::Break => format!("{}break", current_indent), stmt::Delete(targets) => format!("{}del {}", current_indent, vec_to_strings_vec(targets).join(", ")), stmt::Pass => format!("{}pass", current_indent), - stmt::Continue => format!("{}continue", current_indent) + stmt::Continue => format!("{}continue", current_indent), + stmt::Assert(test, msg) => { + format!("{}assert {}{}", + current_indent, + test.to_string(), + { + match msg { + Some(msg) => format!(", {}", msg.to_string()), + None => format!("") + } + } + ) + } } } }