rue-compiler 0.8.4

A compiler for the Rue programming language.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use log::debug;
use rue_ast::{AstNode, AstPathType};
use rue_types::TypeId;

use crate::{Compiler, PathKind, PathResult, compile_path};

pub fn compile_path_type(ctx: &mut Compiler, path: &AstPathType) -> TypeId {
    let PathResult::Type(ty, _) =
        compile_path(ctx, path.syntax(), path.segments(), PathKind::Type, true)
    else {
        debug!("Unresolved path type {}", path.syntax().text());
        return ctx.builtins().unresolved.ty;
    };

    ty
}