summaryrefslogtreecommitdiff
path: root/src/semantic/types.rs
blob: af6c97174c330e476044e01d8192c4d3f3535f5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#[derive(Clone,Debug,Eq,PartialEq)]
pub enum Ty {
    Int,
    String,
    Nil,
    Unit,
    Record(Vec<RecordField>),
}

#[derive(Clone,Debug,Eq,PartialEq)]
pub struct RecordField {
    name: String,
    ty: Box<Ty>,
}

impl RecordField {
    pub fn new(name: String, ty: Ty) -> RecordField {
        RecordField {
            name: name,
            ty: Box::new(ty),
        }
    }
}