nitc :: MEntity :: mdoc_or_fallback
MPackage
s fall back to their root MGroup
.MGroup
s fall back to their default_mmodule
.MClass
es, MClassDef
s, MProperty
s and MPropDef
s fall-back to
their introducing definition.MClassType
s fall back to their wrapped MClass
.MVirtualType
s fall back to their wrapped MProperty
.CallSite
fall back on the wrapped MProperty
.One may use MDoc::original_mentity
to retrieve the original
source of the documentation.
# The documentation associated to the entity or their main nested entity.
#
# * `MPackage`s fall back to their root `MGroup`.
# * `MGroup`s fall back to their `default_mmodule`.
# * `MClass`es, `MClassDef`s, `MProperty`s and `MPropDef`s fall-back to
# their introducing definition.
# * `MClassType`s fall back to their wrapped `MClass`.
# * `MVirtualType`s fall back to their wrapped `MProperty`.
# * `CallSite` fall back on the wrapped `MProperty`.
# * Other entities do not fall back.
#
# One may use `MDoc::original_mentity` to retrieve the original
# source of the documentation.
fun mdoc_or_fallback: nullable MDoc do return mdoc
src/model/mdoc.nit:53,2--66,51
redef fun mdoc_or_fallback
do
# Don’t use `intro.mdoc_or_fallback` because it would create an infinite
# recursion.
return intro.mdoc
end
src/model/model.nit:619,2--624,4
redef fun mdoc_or_fallback do return mdoc or else mclass.mdoc_or_fallback
src/model/model.nit:819,2--74
redef fun mdoc_or_fallback
do
if mdoc != null then return mdoc
var default_mmodule = self.default_mmodule
if default_mmodule == null then return null
return default_mmodule.mdoc_or_fallback
end
src/model/mmodule.nit:64,2--70,4
redef fun mdoc_or_fallback
do
# Don’t use `intro.mdoc_or_fallback` because it would create an infinite
# recursion.
return intro.mdoc
end
src/model/model.nit:2159,2--2164,4
redef fun mdoc_or_fallback do return mdoc or else mproperty.mdoc_or_fallback
src/model/model.nit:2635,2--77
redef fun mdoc_or_fallback do return mclass.mdoc_or_fallback
src/model/model.nit:1393,2--61
redef fun mdoc_or_fallback do return mproperty.mdoc_or_fallback
src/model/model.nit:1622,2--64
redef fun mdoc_or_fallback do return mtype.mdoc_or_fallback
src/model/model.nit:1860,2--60