/// Tries to find the object, but doesn't error.
Tries to find the object, but doesn't error.
Tries to find the object but doesn ' t error .
fn try_find_ref<'a>(
    id: &usize, 
    locals: &'a HashMap<usize, Object>, 
    globals: &'a HashMap<usize, Object>,
    identifiers: &HashMap<usize, String>
) -> Option<&'a Object> {
    if let Some(obj) = locals.get(&id) {
        if let Type::Reference(reference) = obj.obj_type {
            try_find_ref(&reference.pointer, locals, globals, identifiers)
        }
        else {
            Some(obj)
        }
    }
    else if let Some(obj) = globals.get(&id) {
        if let Type::Reference(reference) = obj.obj_type {
            try_find_ref(&reference.pointer, locals, globals, identifiers)
        }
        else {
            Some(obj)
        }
    }
    else {
        None
    }
}
fn try_find_ref < ' a > ( id : & usize , locals : & ' a HashMap < usize , Object > , globals : & ' a HashMap < usize , Object > , identifiers : & HashMap < usize , String > ) -> Option < & ' a Object > { if let Some ( obj ) = locals . get ( & id ) { if let Type :: Reference ( reference ) = obj . obj_type { try_find_ref ( & reference . pointer , locals , globals , identifiers ) } else { Some ( obj ) } } else if let Some ( obj ) = globals . get ( & id ) { if let Type :: Reference ( reference ) = obj . obj_type { try_find_ref ( & reference . pointer , locals , globals , identifiers ) } else { Some ( obj ) } } else { None } }
Tries to find the object, but doesn't error.
Tries to find the object but doesn ' t error .
id
&usize
locals
&'a HashMap<usize, Object>
globals
&'a HashMap<usize, Object>
identifiers
&HashMap<usize, String>