aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/StoreReporter.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/reporting/StoreReporter.scala')
-rw-r--r--src/dotty/tools/dotc/reporting/StoreReporter.scala28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/reporting/StoreReporter.scala b/src/dotty/tools/dotc/reporting/StoreReporter.scala
new file mode 100644
index 000000000..5b9553509
--- /dev/null
+++ b/src/dotty/tools/dotc/reporting/StoreReporter.scala
@@ -0,0 +1,28 @@
+package dotty.tools
+package dotc
+package reporting
+
+import core.Contexts.Context
+import scala.collection.mutable
+import core.Positions.Position
+import Reporter.Severity.{Value => Severity}
+
+/**
+ * This class implements a Reporter that stores all messages
+ */
+class StoreReporter extends Reporter {
+
+ class Info(val msg: String, val severity: Severity, val pos: Position) {
+ override def toString() = "pos: " + pos + " " + msg + " " + severity
+ }
+ val infos = new mutable.LinkedHashSet[Info]
+
+ protected def report(msg: String, severity: Severity, pos: Position)(implicit ctx: Context): Unit = {
+ infos += new Info(msg, severity, pos)
+ }
+
+ override def reset() {
+ super.reset()
+ infos.clear()
+ }
+}