rue_compiler/compile/
ty.rs

1mod group;
2mod lambda;
3mod list;
4mod literal;
5mod pair;
6mod path;
7mod union;
8
9pub use group::*;
10pub use lambda::*;
11pub use list::*;
12pub use literal::*;
13pub use pair::*;
14pub use path::*;
15pub use union::*;
16
17use rue_ast::AstType;
18use rue_types::TypeId;
19
20use crate::Compiler;
21
22pub fn compile_type(ctx: &mut Compiler, ty: &AstType) -> TypeId {
23    match ty {
24        AstType::PathType(path) => compile_path_type(ctx, path),
25        AstType::UnionType(union) => compile_union_type(ctx, union),
26        AstType::GroupType(group) => compile_group_type(ctx, group),
27        AstType::PairType(pair) => compile_pair_type(ctx, pair),
28        AstType::ListType(list) => compile_list_type(ctx, list),
29        AstType::LiteralType(literal) => compile_literal_type(ctx, literal),
30        AstType::LambdaType(lambda) => compile_lambda_type(ctx, lambda),
31    }
32}