Mercurial > python-compiler.rs
comparison src/ast_dump.rs @ 74:97537c90d92d
Add ast.Yield.
author | Bastien Orivel <eijebong@bananium.fr> |
---|---|
date | Mon, 13 Jun 2016 18:25:02 +0200 |
parents | 2a6629ea82b5 |
children | 1abc8ca9f30b |
comparison
equal
deleted
inserted
replaced
73:2a6629ea82b5 | 74:97537c90d92d |
---|---|
185 expr::ListComp(elt, generators) => format!("[{} {}]", elt.to_string(), vec_to_strings_vec(generators).join(" ")), | 185 expr::ListComp(elt, generators) => format!("[{} {}]", elt.to_string(), vec_to_strings_vec(generators).join(" ")), |
186 expr::DictComp(key, value, generators) => format!("{{{}: {} {}}}", key.to_string(), value.to_string(), vec_to_strings_vec(generators).join(" ")), | 186 expr::DictComp(key, value, generators) => format!("{{{}: {} {}}}", key.to_string(), value.to_string(), vec_to_strings_vec(generators).join(" ")), |
187 expr::Tuple(elts, _) => format!("({})", vec_to_strings_vec(elts).join(", ")), | 187 expr::Tuple(elts, _) => format!("({})", vec_to_strings_vec(elts).join(", ")), |
188 expr::Ellipsis => format!("..."), | 188 expr::Ellipsis => format!("..."), |
189 expr::Await(value) => format!("await {}", value.to_string()), | 189 expr::Await(value) => format!("await {}", value.to_string()), |
190 expr::Yield(value) => { | |
191 match *value { | |
192 None => String::from("yield"), | |
193 Some(value) => format!("yield {}", value.to_string()) | |
194 } | |
195 }, | |
190 } | 196 } |
191 } | 197 } |
192 } | 198 } |
193 | 199 |
194 impl to_string_able for arg { | 200 impl to_string_able for arg { |