Skip to content

Commit

Permalink
Start to fix up .^attributes somewhat. This at least resolves an RT, …
Browse files Browse the repository at this point in the history
…but we can't pass S12-introspection/attributes.t just yet.
  • Loading branch information
jnthn committed Jun 5, 2010
1 parent e67ef33 commit b56b5e6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/metamodel/ClassHOW.pir
Expand Up @@ -193,7 +193,7 @@ Attribute descriptors.

# Get list of parents whose attributes we are interested in, and put
# this class on the start. With the local flag , that's just us.
.local pmc parents, parents_it, cur_class, us
.local pmc parents, parents_it, cur_class
unless null tree goto do_tree
if null local goto all_parents
unless local goto all_parents
Expand All @@ -214,8 +214,9 @@ Attribute descriptors.
# If it's us, disregard :tree. Otherwise, if we have :tree, now we call
# ourself recursively and push an array onto the result.
if null tree goto tree_handled
eq_addr cur_class, us, tree_handled
$P0 = self.'attributes'(cur_class, 'tree'=>tree)
eq_addr cur_class, obj, tree_handled
$P0 = cur_class.'HOW'()
$P0 = $P0.'attributes'(cur_class, 'tree'=>tree)
$P0 = '&circumfix:<[ ]>'($P0)
push result_list, $P0
goto parents_it_loop
Expand All @@ -224,7 +225,13 @@ Attribute descriptors.
# Get attributes list and push the attribute descriptors onto
# the results.
.local pmc attributes, attr_it
eq_addr cur_class, obj, local_attrs
$P0 = cur_class.'HOW'()
attributes = $P0.'attributes'(cur_class, 'local'=>1)
goto have_attrs
local_attrs:
attributes = getattribute self, '$!attributes'
have_attrs:
if null attributes goto attr_it_loop_end
attr_it = iter attributes
attr_it_loop:
Expand Down

0 comments on commit b56b5e6

Please sign in to comment.