Mercurial > python-compiler.rs
comparison src/ast_dump.rs @ 80:c6d3f0dabbba
Add ast.IfExp.
author | Bastien Orivel <eijebong@bananium.fr> |
---|---|
date | Mon, 13 Jun 2016 20:12:39 +0200 |
parents | 6bf54bff8dbd |
children | dc82a0d8f144 |
comparison
equal
deleted
inserted
replaced
79:6bf54bff8dbd | 80:c6d3f0dabbba |
---|---|
196 expr::YieldFrom(value) => format!("yield from {}", value.to_string()), | 196 expr::YieldFrom(value) => format!("yield from {}", value.to_string()), |
197 expr::Set(elts) => format!("{{{}}}", vec_to_strings_vec(elts).join(", ")), | 197 expr::Set(elts) => format!("{{{}}}", vec_to_strings_vec(elts).join(", ")), |
198 expr::SetComp(elt, generators) => format!("{{{} {}}}", elt.to_string(), vec_to_strings_vec(generators).join(" ")), | 198 expr::SetComp(elt, generators) => format!("{{{} {}}}", elt.to_string(), vec_to_strings_vec(generators).join(" ")), |
199 expr::GeneratorExp(elt, generators) => format!("({} {})", elt.to_string(), vec_to_strings_vec(generators).join(" ")), | 199 expr::GeneratorExp(elt, generators) => format!("({} {})", elt.to_string(), vec_to_strings_vec(generators).join(" ")), |
200 expr::Lambda(args, body) => format!("lambda {}: {}", args.to_string(), body.to_string()), | 200 expr::Lambda(args, body) => format!("lambda {}: {}", args.to_string(), body.to_string()), |
201 expr::IfExp(test, body, orelse) => format!("{} if {} else {}", body.to_string(), test.to_string(), orelse.to_string()), | |
201 } | 202 } |
202 } | 203 } |
203 } | 204 } |
204 | 205 |
205 impl to_string_able for arg { | 206 impl to_string_able for arg { |