model_views: expect a mainmodule
authorAlexandre Terrasa <alexandre@moz-code.org>
Mon, 16 Oct 2017 03:17:03 +0000 (23:17 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Mon, 16 Oct 2017 03:20:29 +0000 (23:20 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/model/model_views.nit

index 8b0f122..049dea0 100644 (file)
@@ -28,6 +28,9 @@ class ModelView
        # The model to view through `self`.
        var model: Model
 
+       # MModule used to flatten mclass hierarchy
+       var mainmodule: MModule
+
        # MPackages visible through `self`.
        var mpackages: Set[MPackage] is lazy do
                var mpackages = new HashSet[MPackage]
@@ -176,27 +179,6 @@ end
 
 redef class MEntity
 
-       # Get a public view of the model
-       fun public_view: ModelView do
-               var view = new ModelView(self.model)
-               view.min_visibility = public_visibility
-               return view
-       end
-
-       # Get a public view of the model
-       fun protected_view: ModelView do
-               var view = new ModelView(self.model)
-               view.min_visibility = protected_visibility
-               return view
-       end
-
-       # Get a public view of the model
-       fun private_view: ModelView do
-               var view = new ModelView(self.model)
-               view.min_visibility = private_visibility
-               return view
-       end
-
        private fun accept_namespace_visitor(v: LookupNamespaceVisitor) do
                if v.parts.is_empty then return
                if name != v.parts.first then return