/// Add the builtins to a scoreboard.
Add the builtins to a scoreboard.
Add the builtins to a scoreboard .
pub fn register_builtins<'ast, 'ctx>(sb: &ScoreBoard<'ast, 'ctx>) {
    use std::iter::once;
    // Add the builtin scopes.
    sb.scope2_table.borrow_mut().extend(
        (*BUILTIN_SCOPES)
            .iter()
            .map(|&(id, scope)| (id, scope.clone())),
    );
    // Add the builtin types.
    sb.typeval_table.borrow_mut().extend(
        (*STANDARD_BUILTINS)
            .iter()
            .flat_map(|&(ref bi, ref aux)| once(bi).chain(aux.iter()))
            .filter_map(|bi| match bi.ty {
                Some(ref ty) => Some((bi.def.into(), Ok(sb.intern_ty(ty.clone())))),
                None => None,
            }),
    );
}
pub fn register_builtins < ' ast , ' ctx > ( sb : & ScoreBoard < ' ast , ' ctx > ) { use std :: iter :: once ; // Add the builtin scopes. sb . scope2_table . borrow_mut ( ) . extend ( ( * BUILTIN_SCOPES ) . iter ( ) . map ( | & ( id , scope ) | ( id , scope . clone ( ) ) ) , ) ; // Add the builtin types. sb . typeval_table . borrow_mut ( ) . extend ( ( * STANDARD_BUILTINS ) . iter ( ) . flat_map ( | & ( ref bi , ref aux ) | once ( bi ) . chain ( aux . iter ( ) ) ) . filter_map ( | bi | match bi . ty { Some ( ref ty ) => Some ( ( bi . def . into ( ) , Ok ( sb . intern_ty ( ty . clone ( ) ) ) ) ) , None => None , } ) , ) ; }
Add the builtins to a scoreboard.
Add the builtins to a scoreboard .
sb
&ScoreBoard<'ast, 'ctx>