summaryrefslogtreecommitdiffstats
path: root/crates/rebel-parse/src/ast/typ.rs
blob: 939b67d1fa3030d7787432a27f9fc951efd83d4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use super::Path;

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Type<'a> {
	Paren(Box<Type<'a>>),
	Path(Path<'a>),
	Literal(Literal<'a>),
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Literal<'a> {
	Unit,
	Tuple(Vec<Type<'a>>),
	Array(Box<Type<'a>>),
	Struct(Vec<StructField<'a>>),
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct StructField<'a> {
	pub name: &'a str,
	pub typ: Type<'a>,
}