toolcontext: also register messages to the source-files
authorJean Privat <jean@pryen.org>
Sat, 14 May 2016 01:27:47 +0000 (21:27 -0400)
committerJean Privat <jean@pryen.org>
Sat, 14 May 2016 01:27:47 +0000 (21:27 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/toolcontext.nit

index 3190c6d..4583868 100644 (file)
@@ -130,9 +130,16 @@ redef class Location
                        messages = ms
                end
                ms.add m
+               var s = file
+               if s != null then s.messages.add m
        end
 end
 
+redef class SourceFile
+       # Errors and warnings associated to the whole source.
+       var messages = new Array[Message]
+end
+
 # Global context for tools
 class ToolContext
        # Number of errors