From: Alexandre Terrasa Date: Wed, 31 Aug 2016 14:26:29 +0000 (-0400) Subject: src/model: collect package modules X-Git-Url: http://nitlanguage.org src/model: collect package modules Signed-off-by: Alexandre Terrasa --- diff --git a/src/model/model_collect.nit b/src/model/model_collect.nit index d4e40f4..bfe5fdf 100644 --- a/src/model/model_collect.nit +++ b/src/model/model_collect.nit @@ -154,6 +154,18 @@ redef class MPackage end return res end + + # `MModules` contained in `self`. + fun collect_mmodules(view: ModelView): HashSet[MModule] do + var res = new HashSet[MModule] + for mgroup in mgroups do + for mmodule in mgroup.mmodules do + if not view.accept_mentity(mmodule) then continue + res.add(mmodule) + end + end + return res + end end redef class MGroup