- for p in intro_mproperties(none_visibility) do
- if p isa MMethod then
- self_methods += 1
- p.offset = relative_offset_meth
- p.absolute_offset = offset_methods + relative_offset_meth
- relative_offset_meth += 1
- end
- if p isa MAttribute then
- nb_introduced_attributes += 1
- p.offset = relative_offset_attr
- p.absolute_offset = offset_attributes + relative_offset_attr
- relative_offset_attr += 1
+
+ # Update `intro_mmethods` and `intro_mattributes`
+ # For each MClassdef this MClass has
+ for classdef in mclassdefs do
+ # For each property this MClassdef introduce
+ for p in classdef.intro_mproperties do
+ # Collect properties and fixing offsets
+ if p isa MMethod then
+ self_methods += 1
+ p.offset = relative_offset_meth
+ p.absolute_offset = offset_methods + relative_offset_meth
+ relative_offset_meth += 1
+
+ intro_mmethods.add(p)
+ end
+ if p isa MAttribute then
+ nb_introduced_attributes += 1
+ p.offset = relative_offset_attr
+ p.absolute_offset = offset_attributes + relative_offset_attr
+ relative_offset_attr += 1
+
+ intro_mattributes.add(p)
+ end