-class Location
- readable var _file: String
- readable var _line_start: Int
- readable var _line_end: Int
- readable var _column_start: Int
- readable var _column_end: Int
-
- redef meth to_s: String do
- if line_start == line_end then
- if column_start == column_end then
- return "{file}:{line_start},{column_start}"
- else
- return "{file}:{line_start},{column_start}--{column_end}"
- end
+class Message
+special Comparable
+ redef type OTHER: Message
+
+ readable var _location: nullable Location
+ readable var _text: String
+
+ redef fun <(other: OTHER): Bool do
+ if location == null then return true
+ if other.location == null then return false
+
+ return location.as(not null) < other.location.as(not null)
+ end
+
+ redef fun to_s: String do
+ var l = location
+ if l == null then
+ return text