diff options
-rw-r--r-- | parser.c | 10 | ||||
-rw-r--r-- | struct.c | 40 | ||||
-rw-r--r-- | struct.h | 1 |
3 files changed, 7 insertions, 44 deletions
@@ -972,9 +972,7 @@ static void find_matching_syms(lino_completions_t *cpl, if3(package == keyword_package && !force_qualify, null_string, package_name(package))); - val syms = ((kind == 'S' || kind == 'M') - ? hash_keys((get_slot_syms(package, is_cur, tnil(kind == 'M')))) - : get_visible_syms(package, is_cur != nil && !qualify)); + val syms = get_visible_syms(package, is_cur != nil && !qualify); for ( ; syms; syms = cdr(syms)) { val sym = car(syms); @@ -992,7 +990,13 @@ static void find_matching_syms(lino_completions_t *cpl, break; continue; case 'M': + if (static_slot_types(sym)) + break; + continue; case 'S': + if (slot_types(sym)) + break; + continue; break; case 'Q': if (mboundp(sym) || special_operator_p(sym)) @@ -1951,46 +1951,6 @@ val method_name(val fun) return nil; } -val get_slot_syms(val package, val is_current, val method_only) -{ - val result_hash = make_hash(hash_weak_none, nil); - struct hash_iter sthi; - val sth_cell; - - us_hash_iter_init(&sthi, struct_type_hash); - - while ((sth_cell = hash_iter_next(&sthi))) { - val stype = us_cdr(sth_cell); - val sl_iter; - struct struct_type *st = coerce(struct struct_type *, stype->co.handle); - - for (sl_iter = st->slots; sl_iter; sl_iter = cdr(sl_iter)) { - val slot = car(sl_iter); - - if (gethash(result_hash, slot)) - continue; - - if (!is_current && symbol_package(slot) != package) - continue; - - if (!symbol_visible(package, slot)) - continue; - - if (method_only) { - loc ptr = lookup_static_slot(st, slot); - if (nullocp(ptr)) - continue; - if (!functionp(deref(ptr))) - continue; - } - - sethash(result_hash, slot, t); - } - } - - return result_hash; -} - val slot_types(val slot) { uses_or2; @@ -86,7 +86,6 @@ val super_method(val strct, val slotsym); val uslot(val slot); val umethod(val slot, struct args *); val method_name(val fun); -val get_slot_syms(val package, val is_current, val method_only); val slot_types(val slot); val static_slot_types(val slot); val slot_type_reg(val slot, val strct); |