Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
import ordered_tree
private import more_collections
import ordered_tree
private import more_collections
+redef class MEntity
+ # The visibility of the MEntity.
+ #
+ # MPackages, MGroups and MModules are always public.
+ # The visibility of `MClass` and `MProperty` is defined by the keyword used.
+ # `MClassDef` and `MPropDef` return the visibility of `MClass` and `MProperty`.
+ fun visibility: MVisibility do return public_visibility
+end
+
redef class Model
# All known classes
var mclasses = new Array[MClass]
redef class Model
# All known classes
var mclasses = new Array[MClass]
# The visibility of the class
# In Nit, the visibility of a class cannot evolve in refinements
# The visibility of the class
# In Nit, the visibility of a class cannot evolve in refinements
- var visibility: MVisibility
redef var location: Location
redef var location: Location
+ redef fun visibility do return mclass.visibility
+
# Internal name combining the module and the class
# Example: "mymodule$MyClass"
redef var to_s is noinit
# Internal name combining the module and the class
# Example: "mymodule$MyClass"
redef var to_s is noinit
end
# The visibility of the property
end
# The visibility of the property
- var visibility: MVisibility
# Is the property usable as an initializer?
var is_autoinit = false is writable
# Is the property usable as an initializer?
var is_autoinit = false is writable
redef var location: Location
redef var location: Location
+ redef fun visibility do return mproperty.visibility
+
init
do
mclassdef.mpropdefs.add(self)
init
do
mclassdef.mpropdefs.add(self)