Mercurial > python-compiler.rs
diff src/python_ast.rs @ 69:a73eaf42bea1
Add ast.AsyncDefFunction.
author | Bastien Orivel <eijebong@bananium.fr> |
---|---|
date | Mon, 13 Jun 2016 17:54:19 +0200 |
parents | c59ad5ccd8a6 |
children | 2c1e2ce41263 |
line wrap: on
line diff
--- a/src/python_ast.rs +++ b/src/python_ast.rs @@ -9,10 +9,9 @@ pub struct Module { #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub enum stmt { // FunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns) - FunctionDef(String, arguments, Vec<stmt>, Vec<expr>, Option<expr>), - // AsyncFunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns) - //AsyncFunctionDef(String/*, arguments, Vec<expr>), + // If the last field is true, then it's an AsyncFunctionDef. + FunctionDef(String, arguments, Vec<stmt>, Vec<expr>, Option<expr>, bool), // ClassDef(identifier name, expr* bases, keyword* keywords, stmt* body, expr* decorator_list) ClassDef(String, Vec<expr>, Vec<keyword>, Vec<stmt>, Vec<expr>),