fn check_spine(
    prims: &prim::Env,
    metas: &meta::Env,
    span: FileSpan,
    spine: &domain::Spine,
) -> Result<im::Vector<var::Level>, Diagnostic<FileSpan>> {
    spine
        .iter()
        .map(|elim| {
            if let domain::Elim::Fun(_, arg) = elim {
                if let domain::Value::Neutral(domain::Head::Var(var_level), spine) =
                    nbe::force_value(prims, metas, span, arg)?.as_ref()
                {
                    if spine.is_empty() {
                        return Ok(*var_level);
                    }
                }
            }

            // TODO: is this a bug?
            // FIXME: really confusing error?
            Err(Diagnostic::new_error("non-variable in meta spine")
                .with_label(DiagnosticLabel::new_primary(span)))
        })
        .collect()
}
/// Check that all entries in a spine are bound variables.
Check that all entries in a spine are bound variables.
Check that all entries in a spine are bound variables .
fn check_spine(
    prims: &prim::Env,
    metas: &meta::Env,
    span: FileSpan,
    spine: &domain::Spine,
) -> Result<im::Vector<var::Level>, Diagnostic<FileSpan>> {
    spine
        .iter()
        .map(|elim| {
            if let domain::Elim::Fun(_, arg) = elim {
                if let domain::Value::Neutral(domain::Head::Var(var_level), spine) =
                    nbe::force_value(prims, metas, span, arg)?.as_ref()
                {
                    if spine.is_empty() {
                        return Ok(*var_level);
                    }
                }
            }
            // TODO: is this a bug?
            // FIXME: really confusing error?
            Err(Diagnostic::new_error("non-variable in meta spine")
                .with_label(DiagnosticLabel::new_primary(span)))
        })
        .collect()
}
fn check_spine ( prims : & prim :: Env , metas : & meta :: Env , span : FileSpan , spine : & domain :: Spine , ) -> Result < im :: Vector < var :: Level > , Diagnostic < FileSpan > > { spine . iter ( ) . map ( | elim | { if let domain :: Elim :: Fun ( _ , arg ) = elim { if let domain :: Value :: Neutral ( domain :: Head :: Var ( var_level ) , spine ) = nbe :: force_value ( prims , metas , span , arg ) ? . as_ref ( ) { if spine . is_empty ( ) { return Ok ( * var_level ) ; } } } // TODO: is this a bug? // FIXME: really confusing error? Err ( Diagnostic :: new_error ( " " ) . with_label ( DiagnosticLabel :: new_primary ( span ) ) ) } ) . collect ( ) }
Check that all entries in a spine are bound variables.
Check that all entries in a spine are bound variables .
prims
&prim::Env
metas
&meta::Env
span
FileSpan
spine
&domain::Spine
prims
&prim::Env
metas
&meta::Env
span
FileSpan
spine
&domain::Spine