diff src/ast_convert.rs @ 83:e59cd5754268

Add ast.Starred.
author Bastien Orivel <eijebong@bananium.fr>
date Mon, 13 Jun 2016 21:41:14 +0200
parents 2d906d1cb940
children a7b1db623f41
line wrap: on
line diff
--- a/src/ast_convert.rs
+++ b/src/ast_convert.rs
@@ -351,6 +351,7 @@ fn parse_expr(py: Python, ast: PyObject)
     let ifexp_type = ast_module.get(py, "IfExp").unwrap();
     let dict_type = ast_module.get(py, "Dict").unwrap();
     let subscript_type = ast_module.get(py, "Subscript").unwrap();
+    let starred_type = ast_module.get(py, "Starred").unwrap();
 
     assert!(is_instance(&ast, &ast_type));
 
@@ -523,6 +524,13 @@ fn parse_expr(py: Python, ast: PyObject)
         let slice = parse_slice(py, slice);
 
         expr::Subscript(Box::new(value), Box::new(slice), ctx)
+    } else if is_instance(&ast, &starred_type) {
+        let value = ast.getattr(py, "value").unwrap();
+        let ctx = get_ctx(py, ast);
+
+        let value = parse_expr(py, value);
+
+        expr::Starred(Box::new(value), ctx)
     } else {
         println!("expr {}", ast);
         unreachable!()