From: Alexandre Terrasa Date: Thu, 5 Jun 2014 20:59:14 +0000 (-0400) Subject: model_utils: extract mclass mproperties X-Git-Tag: v0.6.6~45^2~8 X-Git-Url: http://nitlanguage.org?ds=sidebyside model_utils: extract mclass mproperties Signed-off-by: Alexandre Terrasa --- diff --git a/src/model_utils.nit b/src/model_utils.nit index 84d5d1d..b2c741b 100644 --- a/src/model_utils.nit +++ b/src/model_utils.nit @@ -200,6 +200,18 @@ redef class MClass return set end + fun intro_mpropdefs(min_visibility: MVisibility): Set[MPropDef] do + var set = new HashSet[MPropDef] + for mclassdef in mclassdefs do + for mpropdef in mclassdef.mpropdefs do + if not mpropdef.is_intro then continue + if mpropdef.mproperty.visibility < min_visibility then continue + set.add(mpropdef) + end + end + return set + end + # the set of locally refined properties in 'self'. fun redef_mproperties(min_visibility: MVisibility): Set[MProperty] do var set = new HashSet[MProperty] @@ -212,6 +224,18 @@ redef class MClass return set end + fun redef_mpropdefs(min_visibility: MVisibility): Set[MPropDef] do + var set = new HashSet[MPropDef] + for mclassdef in mclassdefs do + for mpropdef in mclassdef.mpropdefs do + if mpropdef.is_intro then continue + if mpropdef.mproperty.visibility < min_visibility then continue + set.add(mpropdef) + end + end + return set + end + # the set of methods inherited by 'self'. fun inherited_mproperties(mainmodule: MModule, min_visibility: MVisibility): Set[MProperty] do var set = new HashSet[MProperty]