ni_nitdoc: sort lists by alphabetic order
authorStefan Lage <lagestfan@gmail.com>
Thu, 4 Jul 2013 00:03:38 +0000 (20:03 -0400)
committerStefan Lage <lagestfan@gmail.com>
Thu, 4 Jul 2013 18:41:43 +0000 (14:41 -0400)
Signed-off-by: Stefan Lage <lagestfan@gmail.com>

src/ni_nitdoc.nit

index c275819..8180449 100644 (file)
@@ -1000,6 +1000,10 @@ end
 
 redef class MModule
 
+       super Comparable
+       redef type OTHER: MModule
+       redef fun <(other: OTHER): Bool do return self.name < other.name
+
        var amodule: nullable AModule
 
        # Get the list of all methods in a module
@@ -1027,6 +1031,10 @@ end
 
 redef class MProperty
 
+       super Comparable
+       redef type OTHER: MProperty
+       redef fun <(other: OTHER): Bool do return self.name < other.name
+
        var is_redef: Bool
        var apropdef: nullable APropdef
 
@@ -1057,6 +1065,10 @@ end
 
 redef class MClass
 
+       super Comparable
+       redef type OTHER: MClass
+       redef fun <(other: OTHER): Bool do return self.name < other.name
+
        # Associate all MMethods to each MModule concerns
        fun all_methods: HashMap[MModule, Set[MMethod]] do
                var hm = new HashMap[MModule, Set[MMethod]]