fn exec_all(
    simple_factory: &dyn Fn(usize, bool) -> Simple,
    not: bool,
    locals: &mut HashMap<usize, Object>,
    globals: &mut HashMap<usize, Object>,
    identifiers: &HashMap<usize, String>
) {
    // Get all YOU keys in the current scope
    let all_loc: Vec<usize> = locals.iter()
        .filter(|(_, v)| matches!(
            v, Object { reference_count: _, obj_type: Type::You(_)}
        ) || matches!(
            v, Object { reference_count: _, obj_type: Type::You2(_)}
        ))
        .map(|(&k, _)| k)
        .collect();
    let all_glob: Vec<usize> = globals.iter()
        .filter(|(_, v)| matches!(
            v, Object { reference_count: _, obj_type: Type::You(_)}
        ) || matches!(
            v, Object { reference_count: _, obj_type: Type::You2(_)}
        ))
        .map(|(&k, _)| k)
        .collect();
    for id in all_loc {
        exec_simple(&simple_factory(id, not), locals, globals, identifiers);
    }
    for id in all_glob {
        exec_simple(&simple_factory(id, not), locals, globals, identifiers);
    }
}
/// Executes a simple YOU instruction for every YOU object in the current scope.
Executes a simple YOU instruction for every YOU object in the current scope.
Executes a simple YOU instruction for every YOU object in the current scope .
fn exec_all(
    simple_factory: &dyn Fn(usize, bool) -> Simple,
    not: bool,
    locals: &mut HashMap<usize, Object>,
    globals: &mut HashMap<usize, Object>,
    identifiers: &HashMap<usize, String>
) {
    // Get all YOU keys in the current scope
    let all_loc: Vec<usize> = locals.iter()
        .filter(|(_, v)| matches!(
            v, Object { reference_count: _, obj_type: Type::You(_)}
        ) || matches!(
            v, Object { reference_count: _, obj_type: Type::You2(_)}
        ))
        .map(|(&k, _)| k)
        .collect();
    let all_glob: Vec<usize> = globals.iter()
        .filter(|(_, v)| matches!(
            v, Object { reference_count: _, obj_type: Type::You(_)}
        ) || matches!(
            v, Object { reference_count: _, obj_type: Type::You2(_)}
        ))
        .map(|(&k, _)| k)
        .collect();
    for id in all_loc {
        exec_simple(&simple_factory(id, not), locals, globals, identifiers);
    }
    for id in all_glob {
        exec_simple(&simple_factory(id, not), locals, globals, identifiers);
    }
}
fn exec_all ( simple_factory : & dyn Fn ( usize , bool ) -> Simple , not : bool , locals : & mut HashMap < usize , Object > , globals : & mut HashMap < usize , Object > , identifiers : & HashMap < usize , String > ) { // Get all YOU keys in the current scope let all_loc : Vec < usize > = locals . iter ( ) . filter ( | ( _ , v ) | matches ! ( v Object { reference_count obj_type Type You ( ) } ) || matches ! ( v Object { reference_count obj_type Type You2 ( ) } ) ) . map ( | ( & k , _ ) | k ) . collect ( ) ; let all_glob : Vec < usize > = globals . iter ( ) . filter ( | ( _ , v ) | matches ! ( v Object { reference_count obj_type Type You ( ) } ) || matches ! ( v Object { reference_count obj_type Type You2 ( ) } ) ) . map ( | ( & k , _ ) | k ) . collect ( ) ; for id in all_loc { exec_simple ( & simple_factory ( id , not ) , locals , globals , identifiers ) ; } for id in all_glob { exec_simple ( & simple_factory ( id , not ) , locals , globals , identifiers ) ; } }
Executes a simple YOU instruction for every YOU object in the current scope.
Executes a simple YOU instruction for every YOU object in the current scope .
simple_factory
&dyn Fn(usize, bool) -> Simple
not
bool
locals
&mut HashMap<usize, Object>
globals
&mut HashMap<usize, Object>
identifiers
&HashMap<usize, String>
simple_factory
&dyn Fn(usize, bool) -> Simple
not
bool
locals
&mut HashMap<usize, Object>
globals
&mut HashMap<usize, Object>
identifiers
&HashMap<usize, String>