Mercurial > python-compiler.rs
comparison src/ast_dump.rs @ 17:f1c77634a2eb
Add ast.Tuple
author | Bastien Orivel <eijebong@bananium.fr> |
---|---|
date | Thu, 02 Jun 2016 23:47:54 +0200 |
parents | b21a246349f3 |
children | 0cb53a31ac12 |
comparison
equal
deleted
inserted
replaced
16:b21a246349f3 | 17:f1c77634a2eb |
---|---|
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 expr::DictComp(key, value, generators) => format!("{{{}: {} {}}}", key.to_string(), value.to_string(), generators_to_string(generators)), |
152 expr::Tuple(elts, ctx) => format!("({})", args_to_string(elts)) | |
152 } | 153 } |
153 } | 154 } |
154 } | 155 } |
155 | 156 |
156 impl arguments { | 157 impl arguments { |