Front page | perl.cvs.parrot |
Postings from December 2008
[svn:parrot] r34699 - trunk/src/pmc
From:
bernhard
Date:
December 31, 2008 04:19
Subject:
[svn:parrot] r34699 - trunk/src/pmc
Message ID:
20081231121913.03E34CB9FA@x12.develooper.com
Author: bernhard
Date: Wed Dec 31 04:19:12 2008
New Revision: 34699
Modified:
trunk/src/pmc/class.pmc
Log:
Rename varible from nondescript 'table' to 'attrib_metadata'.
Update docs: the attributes array is not the attrib_metadata table.
Modified: trunk/src/pmc/class.pmc
==============================================================================
--- trunk/src/pmc/class.pmc (original)
+++ trunk/src/pmc/class.pmc Wed Dec 31 04:19:12 2008
@@ -105,14 +105,13 @@
build_attrib_index(PARROT_INTERP, PMC *self)
{
Parrot_Class_attributes * const _class = PARROT_CLASS(self);
- int cur_index = 0;
- PMC * const table = pmc_new(interp, enum_class_Hash);
- PMC * const cache = pmc_new(interp, enum_class_Hash);
- const int num_classes = VTABLE_elements(interp,
- _class->all_parents);
+ int cur_index = 0;
+ PMC * const attrib_index = pmc_new(interp, enum_class_Hash);
+ PMC * const cache = pmc_new(interp, enum_class_Hash);
+ const int num_classes = VTABLE_elements(interp, _class->all_parents);
int i;
- /* We will go over the list of all parents to construct the table. */
+ /* We will go over the list of all parents to construct the attribute index. */
for (i = 0; i < num_classes; i++) {
/* Get the class and check that it respects the standard class interface
* (if not we don't know how it stores its attributes, so we'll have to
@@ -146,15 +145,15 @@
STRING *full_key = string_append(interp, fq_class, attrib_name);
/* Insert into hash, along with index. */
- VTABLE_set_integer_keyed_str(interp, table, full_key, cur_index);
+ VTABLE_set_integer_keyed_str(interp, attrib_index, full_key, cur_index);
VTABLE_set_integer_keyed_str(interp, class_cache, attrib_name, cur_index);
cur_index++;
}
}
}
- /* Store built table and invalidate cache. */
- _class->attrib_index = table;
+ /* Store built attribute index and invalidate cache. */
+ _class->attrib_index = attrib_index;
_class->attrib_cache = cache;
}
@@ -636,7 +635,7 @@
Adds the given attribute (C<name>) with an optional C<type>.
Creates a new class if the current class has been instantiated.
-Enters the attribute in the C<attributes> array.
+Enters the attribute in the C<attrib_metadata> table.
Returns an error if an attribute of C<name> already exists.
=cut
@@ -664,7 +663,7 @@
if (!PMC_IS_NULL(type))
VTABLE_set_pmc_keyed_str(interp, new_attribute, CONST_STRING(interp, "type"), type);
- /* Enter the attribute in the attributes array. */
+ /* Enter the attribute in the attrib_metadata table. */
VTABLE_set_pmc_keyed_str(interp, _class->attrib_metadata, name,
new_attribute);
}
-
[svn:parrot] r34699 - trunk/src/pmc
by bernhard