comparison 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
comparison
equal deleted inserted replaced
6:6f2bf13f4cb5 7:680d15073f55
7 Top(usize), 7 Top(usize),
8 Unit, 8 Unit,
9 Bool, 9 Bool,
10 Int, 10 Int,
11 Str, 11 Str,
12 List(Box<Type>),
12 Function(Vec<Type>, Vec<Type>), 13 Function(Vec<Type>, Vec<Type>),
13 Bottom 14 Bottom
14 } 15 }
15 16
16 struct TypeVariable { 17 struct TypeVariable {
234 Type::Bottom 235 Type::Bottom
235 } 236 }
236 }, 237 },
237 Expr::Str(_) => Type::Str, 238 Expr::Str(_) => Type::Str,
238 Expr::Num(_) => Type::Int, 239 Expr::Num(_) => Type::Int,
240 Expr::List(_) => Type::List(Box::new(Type::Bottom)),
239 Expr::Error => { 241 Expr::Error => {
240 println!("Expr::Error"); 242 println!("Expr::Error");
241 panic!() 243 panic!()
242 } 244 }
243 }; 245 };