Mercurial > python-compiler.rs
comparison src/ast_convert.rs @ 3:326d7f2a94d4
Remove useless abstraction of function name as Expr.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 31 May 2016 02:36:24 +0100 |
parents | 5fc7c2790d8c |
children | f27a4aee9dfa |
comparison
equal
deleted
inserted
replaced
2:5fc7c2790d8c | 3:326d7f2a94d4 |
---|---|
256 for statement in body.iter(py).unwrap() { | 256 for statement in body.iter(py).unwrap() { |
257 let statement = parse_statement(py, statement.unwrap()); | 257 let statement = parse_statement(py, statement.unwrap()); |
258 statements.push(statement); | 258 statements.push(statement); |
259 } | 259 } |
260 | 260 |
261 Statement::FunctionDef(Expr::Name(name), args, statements) | 261 Statement::FunctionDef(name, args, statements) |
262 } else if is_instance(&ast, &global_type) { | 262 } else if is_instance(&ast, &global_type) { |
263 let names = ast.getattr(py, "names").unwrap(); | 263 let names = ast.getattr(py, "names").unwrap(); |
264 | 264 |
265 let mut globals = vec!(); | 265 let mut globals = vec!(); |
266 for name in names.iter(py).unwrap() { | 266 for name in names.iter(py).unwrap() { |