From 7872b45bf462a55835dd56473e7d8ae179f699fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Christophe=20Beaupr=C3=A9?= Date: Mon, 22 Aug 2016 16:25:23 -0400 Subject: [PATCH] model: Promote definitions of `mdoc_or_fallback` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Merge duplicates. Signed-off-by: Jean-Christophe Beaupré --- src/doc/console_templates/console_model.nit | 5 ----- src/doc/html_templates/model_html.nit | 7 ------- src/model/model.nit | 8 ++++++-- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/doc/console_templates/console_model.nit b/src/doc/console_templates/console_model.nit index 96b1a40..cacac49 100644 --- a/src/doc/console_templates/console_model.nit +++ b/src/doc/console_templates/console_model.nit @@ -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. diff --git a/src/doc/html_templates/model_html.nit b/src/doc/html_templates/model_html.nit index 0310a9c..20ae4ed 100644 --- a/src/doc/html_templates/model_html.nit +++ b/src/doc/html_templates/model_html.nit @@ -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. diff --git a/src/model/model.nit b/src/model/model.nit index 2243a88..512883a 100644 --- a/src/model/model.nit +++ b/src/model/model.nit @@ -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 -- 1.7.9.5