Mercurial > python-compiler.rs
comparison src/ast_dump.rs @ 16:b21a246349f3
Add ast.DictComp
author | Bastien Orivel <eijebong@bananium.fr> |
---|---|
date | Thu, 02 Jun 2016 22:20:48 +0200 |
parents | 719a27f1c1c7 |
children | f1c77634a2eb |
comparison
equal
deleted
inserted
replaced
15:a0fb169fe0f9 | 16:b21a246349f3 |
---|---|
145 expr::Str(s) => format!("\"{}\"", s), | 145 expr::Str(s) => format!("\"{}\"", s), |
146 expr::NameConstant(name) => format!("{}", name), | 146 expr::NameConstant(name) => format!("{}", name), |
147 expr::Attribute(value, attr, ctx) => format!("{}.{}", value.to_string(), attr), | 147 expr::Attribute(value, attr, ctx) => format!("{}.{}", value.to_string(), attr), |
148 expr::Name(name, ctx) => format!("{}", name), | 148 expr::Name(name, ctx) => format!("{}", name), |
149 expr::List(elts, ctx) => format!("[{}]", args_to_string(elts)), | 149 expr::List(elts, ctx) => format!("[{}]", args_to_string(elts)), |
150 expr::ListComp(elt, generators) => format!("[{} {}]", elt.to_string(), generators_to_string(generators)) | 150 expr::ListComp(elt, generators) => format!("[{} {}]", elt.to_string(), generators_to_string(generators)), |
151 expr::DictComp(key, value, generators) => format!("{{{}: {} {}}}", key.to_string(), value.to_string(), generators_to_string(generators)) | |
151 } | 152 } |
152 } | 153 } |
153 } | 154 } |
154 | 155 |
155 impl arguments { | 156 impl arguments { |