Mercurial > python-compiler.rs
diff src/ast_type.rs @ 7:680d15073f55
Add ast.List literal.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 31 May 2016 04:26:58 +0100 |
parents | 6f2bf13f4cb5 |
children | 94ff501bf336 |
line wrap: on
line diff
--- a/src/ast_type.rs +++ b/src/ast_type.rs @@ -9,6 +9,7 @@ enum Type { Bool, Int, Str, + List(Box<Type>), Function(Vec<Type>, Vec<Type>), Bottom } @@ -236,6 +237,7 @@ impl Visitor<Type> for Typing { }, Expr::Str(_) => Type::Str, Expr::Num(_) => Type::Int, + Expr::List(_) => Type::List(Box::new(Type::Bottom)), Expr::Error => { println!("Expr::Error"); panic!()