Mercurial > python-compiler.rs
comparison src/ast_dump.rs @ 67:8ce78e2ba48c
Implement class keywords.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 13 Jun 2016 01:43:19 +0100 |
parents | 32550e12aedf |
children | c59ad5ccd8a6 |
comparison
equal
deleted
inserted
replaced
66:32550e12aedf | 67:8ce78e2ba48c |
---|---|
241 stmt::ClassDef(name, bases, keywords, body, decorator_list) => { | 241 stmt::ClassDef(name, bases, keywords, body, decorator_list) => { |
242 format!("{}{}class {}({}):\n{}", | 242 format!("{}{}class {}({}):\n{}", |
243 decorator_list_to_string(decorator_list, indent), | 243 decorator_list_to_string(decorator_list, indent), |
244 current_indent, | 244 current_indent, |
245 name, | 245 name, |
246 vec_to_strings_vec(bases).join(", "), | 246 { |
247 let mut arguments = vec!(); | |
248 let bases = vec_to_strings_vec(bases); | |
249 let keywords = vec_to_strings_vec(keywords); | |
250 arguments.extend(bases); | |
251 arguments.extend(keywords); | |
252 arguments.join(", ") | |
253 }, | |
247 statements_to_string(indent, body) | 254 statements_to_string(indent, body) |
248 ) | 255 ) |
249 }, | 256 }, |
250 stmt::FunctionDef(name, arguments, body, decorator_list, returns) => { | 257 stmt::FunctionDef(name, arguments, body, decorator_list, returns) => { |
251 format!("{}{}def {}({}){}:\n{}", | 258 format!("{}{}def {}({}){}:\n{}", |