gc: default to nitgc when boehm is not available
[nit.git] / src / mmloader.nit
index 0533e02..60e84f1 100644 (file)
@@ -27,8 +27,8 @@ class Message
 special Comparable
        redef type OTHER: Message
 
-       readable attr _location: nullable Location
-       readable attr _text: String
+       readable var _location: nullable Location
+       readable var _text: String
 
        redef fun <(other: OTHER): Bool do
                if location == null then return true
@@ -36,6 +36,14 @@ special Comparable
 
                return location.as(not null) < other.location.as(not null)
        end
+
+       redef fun to_s: String do
+               if location == null then
+                       return text
+               else
+                       return "{location}: {text}"
+               end
+       end
 end
 
 # Global context for tools
@@ -57,7 +65,7 @@ special MMContext
                        _message_sorter.sort(_messages)
 
                        for m in _messages do
-                               stderr.write("{m.text}\n")
+                               stderr.write("{m}\n")
                        end
 
                        _messages.clear
@@ -93,7 +101,7 @@ special MMContext
        end
 
        # Display an info
-       meth info(s: String, level: Int)
+       fun info(s: String, level: Int)
        do
                if level <= verbose_level then
                        print "{s}"
@@ -250,7 +258,6 @@ special MMContext
        # If the module is already loaded, just return it without further processing.
        fun get_module(module_name: Symbol, from: nullable MMModule): MMModule
        do
-               var m: MMModule
                if from != null then
                        var dir: nullable MMDirectory = from.directory
                        while dir != null do