model: Promote definitions of `mdoc_or_fallback`
authorJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Mon, 22 Aug 2016 20:25:23 +0000 (16:25 -0400)
committerJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Wed, 22 Mar 2017 18:57:10 +0000 (14:57 -0400)
Merge duplicates.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

src/doc/console_templates/console_model.nit
src/doc/html_templates/model_html.nit
src/model/model.nit

index 96b1a40..cacac49 100644 (file)
@@ -208,7 +208,6 @@ redef class MModule
 end
 
 redef class MClass
-       redef fun mdoc_or_fallback do return intro.mdoc
        redef fun cs_icon do return intro.cs_icon
 
        # Format: `Foo[E]`
@@ -258,7 +257,6 @@ redef class MClass
 end
 
 redef class MClassDef
-       redef fun mdoc_or_fallback do return mdoc or else mclass.mdoc_or_fallback
        redef fun cs_icon do return "C"
 
        # Depends if `self` is an intro or not.
@@ -339,7 +337,6 @@ redef class MClassDef
 end
 
 redef class MProperty
-       redef fun mdoc_or_fallback do return intro.mdoc
        redef fun cs_modifiers do return intro.cs_modifiers
        redef fun cs_declaration do return intro.cs_declaration
        redef fun cs_icon do return intro.cs_icon
@@ -373,8 +370,6 @@ redef class MProperty
 end
 
 redef class MPropDef
-       redef fun mdoc_or_fallback do return mdoc or else mproperty.mdoc_or_fallback
-
        # Depends if `self` is an intro or not.
        #
        # * If intro contains the visibility and kind.
index 0310a9c..20ae4ed 100644 (file)
@@ -155,8 +155,6 @@ redef class MModule
 end
 
 redef class MClass
-       redef fun mdoc_or_fallback do return intro.mdoc
-
        # Format: `Foo[E]`
        redef var html_name is lazy do
                var tpl = new Template
@@ -201,8 +199,6 @@ redef class MClass
 end
 
 redef class MClassDef
-       redef fun mdoc_or_fallback do return mdoc or else mclass.mdoc_or_fallback
-
        # Depends if `self` is an intro or not.
        #
        # * If intro contains the visibility and kind.
@@ -303,7 +299,6 @@ redef class MClassDef
 end
 
 redef class MProperty
-       redef fun mdoc_or_fallback do return intro.mdoc
        redef fun html_modifiers do return intro.html_modifiers
        redef fun html_declaration do return intro.html_declaration
 
@@ -327,8 +322,6 @@ redef class MProperty
 end
 
 redef class MPropDef
-       redef fun mdoc_or_fallback do return mdoc or else mproperty.mdoc_or_fallback
-
        # Depends if `self` is an intro or not.
        #
        # * If intro contains the visibility and kind.
index 2243a88..512883a 100644 (file)
@@ -566,7 +566,7 @@ class MClass
        # Is `self` and abstract class?
        var is_abstract: Bool is lazy do return kind == abstract_kind
 
-       redef fun mdoc_or_fallback do return intro.mdoc_or_fallback
+       redef fun mdoc_or_fallback do return intro.mdoc
 end
 
 
@@ -725,6 +725,8 @@ class MClassDef
 
        # All property introductions and redefinitions (not inheritance) in `self` by its associated property.
        var mpropdefs_by_property = new HashMap[MProperty, MPropDef]
+
+       redef fun mdoc_or_fallback do return mdoc or else mclass.mdoc_or_fallback
 end
 
 # A global static type
@@ -2049,7 +2051,7 @@ abstract class MProperty
 
        redef var location
 
-       redef fun mdoc_or_fallback do return intro.mdoc_or_fallback
+       redef fun mdoc_or_fallback do return intro.mdoc
 
        # The canonical name of the property.
        #
@@ -2471,6 +2473,8 @@ abstract class MPropDef
                assert has_next_property: i.is_ok
                return i.item
        end
+
+       redef fun mdoc_or_fallback do return mdoc or else mproperty.mdoc_or_fallback
 end
 
 # A local definition of a method