pub fn elaborate_universe(
    context: &TermContext<'_>,
    surface_term: &surface::Term,
    report: &mut dyn FnMut(Diagnostic),
) -> core::Term {
    match surface_term {
        surface::Term::Name(span, name)
            if !context.items.contains_key("Type") && name.as_str() == "Type" =>
        {
            core::Term::Universe(*span, core::Universe::Type)
        }
        surface::Term::Name(span, name)
            if !context.items.contains_key("Format") && name.as_str() == "Format" =>
        {
            core::Term::Universe(*span, core::Universe::Format)
        }
        surface::Term::Name(span, name)
            if !context.items.contains_key("Kind") && name.as_str() == "Kind" =>
        {
            core::Term::Universe(*span, core::Universe::Kind)
        }
        surface_term => match synth_term(context, surface_term, report) {
            (core_term, core::Value::Universe(_)) | (core_term, core::Value::Error) => core_term,
            (_, ty) => {
                let span = surface_term.span();
                report(diagnostics::universe_mismatch(
                    Severity::Error,
                    context.file_id,
                    span,
                    &ty,
                ));
                core::Term::Error(span)
            }
        },
    }
}
/// Check that a surface term is a type or kind, and elaborate it into the core syntax.
Check that a surface term is a type or kind, and elaborate it into the core syntax.
Check that a surface term is a type or kind and elaborate it into the core syntax .
pub fn elaborate_universe(
    context: &TermContext<'_>,
    surface_term: &surface::Term,
    report: &mut dyn FnMut(Diagnostic),
) -> core::Term {
    match surface_term {
        surface::Term::Name(span, name)
            if !context.items.contains_key("Type") && name.as_str() == "Type" =>
        {
            core::Term::Universe(*span, core::Universe::Type)
        }
        surface::Term::Name(span, name)
            if !context.items.contains_key("Format") && name.as_str() == "Format" =>
        {
            core::Term::Universe(*span, core::Universe::Format)
        }
        surface::Term::Name(span, name)
            if !context.items.contains_key("Kind") && name.as_str() == "Kind" =>
        {
            core::Term::Universe(*span, core::Universe::Kind)
        }
        surface_term => match synth_term(context, surface_term, report) {
            (core_term, core::Value::Universe(_)) | (core_term, core::Value::Error) => core_term,
            (_, ty) => {
                let span = surface_term.span();
                report(diagnostics::universe_mismatch(
                    Severity::Error,
                    context.file_id,
                    span,
                    &ty,
                ));
                core::Term::Error(span)
            }
        },
    }
}
pub fn elaborate_universe ( context : & TermContext < ' _ > , surface_term : & surface :: Term , report : & mut dyn FnMut ( Diagnostic ) , ) -> core :: Term { match surface_term { surface :: Term :: Name ( span , name ) if ! context . items . contains_key ( " " ) && name . as_str ( ) == " " => { core :: Term :: Universe ( * span , core :: Universe :: Type ) } surface :: Term :: Name ( span , name ) if ! context . items . contains_key ( " " ) && name . as_str ( ) == " " => { core :: Term :: Universe ( * span , core :: Universe :: Format ) } surface :: Term :: Name ( span , name ) if ! context . items . contains_key ( " " ) && name . as_str ( ) == " " => { core :: Term :: Universe ( * span , core :: Universe :: Kind ) } surface_term => match synth_term ( context , surface_term , report ) { ( core_term , core :: Value :: Universe ( _ ) ) | ( core_term , core :: Value :: Error ) => core_term , ( _ , ty ) => { let span = surface_term . span ( ) ; report ( diagnostics :: universe_mismatch ( Severity :: Error , context . file_id , span , & ty , ) ) ; core :: Term :: Error ( span ) } } , } }
Check that a surface term is a type or kind, and elaborate it into the core syntax.
Check that a surface term is a type or kind and elaborate it into the core syntax .
context
&TermContext<'_>
surface_term
&surface::Term
report
&mut dyn FnMut(Diagnostic)
context
&TermContext<'_>
surface_term
&surface::Term
report
&mut dyn FnMut(Diagnostic)