Skip to content

Commit

Permalink
First cut of starting to get 'is hidden' do work again. Not a complet…
Browse files Browse the repository at this point in the history
…e implementation.
  • Loading branch information
jnthn committed Jul 2, 2010
1 parent 5954d61 commit 9551482
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/core/traits.pm
Expand Up @@ -16,6 +16,10 @@ multi trait_mod:<is>(Mu $type where { !.defined }, :$rw!) {
$type.HOW does role { method rw { True } }
}

multi trait_mod:<is>(Mu $type where { !.defined }, :$hidden!) {
$type.HOW does role { method hidden { True } }
}

multi trait_mod:<is>(Routine $r, :$default!) {
$r does role { method default { True } }
}
Expand Down
10 changes: 7 additions & 3 deletions src/pmc/p6opaque.pmc
Expand Up @@ -182,9 +182,13 @@ PMC *look_for_method(PARROT_INTERP, PMC *search_list, INTVAL *start_pos, STRING
int j, k, found;

/* Does this class have the is hidden property? */
PMC *hidden = VTABLE_get_attr_str(interp, my_metaclass, CONST_STRING(interp, "$!hidden"));
if (!PMC_IS_NULL(hidden) && VTABLE_get_bool(interp, hidden))
continue;
PMC *hidden_meth = VTABLE_find_method(interp, my_metaclass, CONST_STRING(interp, "hidden"));
if (!PMC_IS_NULL(hidden_meth)) {
PMC *result = PMCNULL;
Parrot_ext_call(interp, hidden_meth, "Pi->P", my_metaclass, &result);
if (VTABLE_get_bool(interp, result))
continue;
}

/* Does anything before it hide it? */
found = 0;
Expand Down

0 comments on commit 9551482

Please sign in to comment.