Mercurial > python-compiler.rs
diff src/ast_convert.rs @ 64:53817b39f139
Add FunctionDef.decorator_list support.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 13 Jun 2016 01:18:48 +0100 |
parents | 5df52b40fe54 |
children | ce5e27a3f277 |
line wrap: on
line diff
--- a/src/ast_convert.rs +++ b/src/ast_convert.rs @@ -564,16 +564,16 @@ 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 decorator_list = ast.getattr(py, "decorator_list").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 decorator_list = parse_list(py, decorator_list, parse_expr); let returns = parse_optional_expr(py, returns); - stmt::FunctionDef(name, args, body, decorators, returns) + stmt::FunctionDef(name, args, body, decorator_list, returns) } else if is_instance(&ast, &global_type) { let names = ast.getattr(py, "names").unwrap(); let names = parse_list(py, names, get_str);