model_utils: move `MEntityNameSorter` to `model_base`.
authorAlexandre Terrasa <alexandre@moz-code.org>
Thu, 21 May 2015 22:22:29 +0000 (18:22 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Fri, 29 May 2015 23:10:10 +0000 (19:10 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/model/model_base.nit
src/model_utils.nit

index fd2e1d1..396d5e1 100644 (file)
@@ -102,6 +102,16 @@ class MVisibility
        end
 end
 
+# A `Comparator` to sort mentities by their names.
+class MEntityNameSorter
+       super Comparator
+
+       redef type COMPARED: MEntity
+
+       # Returns `a.name <=> b.name`.
+       redef fun compare(a, b) do return a.name <=> b.name
+end
+
 # The visibility level `intrude`
 fun intrude_visibility: MVisibility do return once new MVisibility("intrude", 5)
 # The visibility level `public`
index af8d285..eb4d82b 100644 (file)
@@ -414,12 +414,3 @@ redef class MPropDef
                return res
        end
 end
-
-# Sorters
-
-# Sort mentities by their name
-class MEntityNameSorter
-       super Comparator
-       redef type COMPARED: MEntity
-       redef fun compare(a, b) do return a.name <=> b.name
-end