Mercurial > python-compiler.rs
diff src/ast_convert.rs @ 63:5df52b40fe54
Implement FunctionDef.returns.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 13 Jun 2016 00:55:04 +0100 |
parents | 6b73843c5b4a |
children | 53817b39f139 |
line wrap: on
line diff
--- a/src/ast_convert.rs +++ b/src/ast_convert.rs @@ -564,13 +564,14 @@ fn parse_statement(py: Python, ast: PyOb let name = ast.getattr(py, "name").unwrap(); let args = ast.getattr(py, "args").unwrap(); let body = ast.getattr(py, "body").unwrap(); + let returns = ast.getattr(py, "returns").unwrap(); let name = get_str(py, name); let args = parse_arguments(py, args); let body = parse_list(py, body, parse_statement); let decorators = vec!(); - let returns = None; + let returns = parse_optional_expr(py, returns); stmt::FunctionDef(name, args, body, decorators, returns) } else if is_instance(&ast, &global_type) {