neo_doxygen: Add an option to remove the `def` keyword of Python.
[nit.git] / contrib / neo_doxygen / src / doxml / language_specific.nit
index bbc6410..9566f9e 100644 (file)
@@ -131,7 +131,6 @@ abstract class SourceLanguage
 
                var content = text_array.last.as(String).r_trim
                var link = text.links.first
-               var found = false
 
                if link == null and content.has_suffix(suffix) then
                        content = content.substring(0, content.length - suffix.length).r_trim
@@ -162,7 +161,9 @@ class JavaSource
                # For abstract members, Doxygen put `abstract` at the beginning of the type.
                # We assume that Doxygen do not put annotations in the type (it seems to
                # be the case).
-               member.is_abstract = extract_keyword(type_text, "abstract")
+               if extract_keyword(type_text, "abstract") then
+                       member.is_abstract = true
+               end
                # TODO final
                # TODO void
                # TODO Avoid using `RawType` when possible. Only use `RawType` as a fallback.
@@ -178,3 +179,14 @@ class JavaSource
                super
        end
 end
+
+# Importation logics for Python.
+class PythonSource
+       super SourceLanguage
+
+       redef fun apply_member_type(member, type_text) do
+               # Doxygen may forgot to remove the `def` keyword on methods.
+               extract_keyword(type_text, "def")
+               super
+       end
+end