aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/StoreReporter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-07-19 19:08:42 +0200
committerMartin Odersky <odersky@gmail.com>2013-07-19 19:08:42 +0200
commit919310a29daebabe3335d428f5f5e52ed6295cbd (patch)
tree8f8e898afb10b3735cd1aa6101f19b19fbf18682 /src/dotty/tools/dotc/reporting/StoreReporter.scala
parent702c4fc89f3ff2abbc7457fd72ab19b5bbdbb782 (diff)
downloaddotty-919310a29daebabe3335d428f5f5e52ed6295cbd.tar.gz
dotty-919310a29daebabe3335d428f5f5e52ed6295cbd.tar.bz2
dotty-919310a29daebabe3335d428f5f5e52ed6295cbd.zip
Made reporting framework more lightweight and uniform in preparation of future integration of reporters in typerstate.
Diffstat (limited to 'src/dotty/tools/dotc/reporting/StoreReporter.scala')
-rw-r--r--src/dotty/tools/dotc/reporting/StoreReporter.scala22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/dotty/tools/dotc/reporting/StoreReporter.scala b/src/dotty/tools/dotc/reporting/StoreReporter.scala
index 6818825f7..54daf2b6b 100644
--- a/src/dotty/tools/dotc/reporting/StoreReporter.scala
+++ b/src/dotty/tools/dotc/reporting/StoreReporter.scala
@@ -3,26 +3,20 @@ package dotc
package reporting
import core.Contexts.Context
-import scala.collection.mutable
-import util.SourcePosition
-import Reporter.Severity.{Value => Severity}
+import collection.mutable
+import Reporter.Diagnostic
/**
* This class implements a Reporter that stores all messages
*/
class StoreReporter(ctx: Context) extends Reporter(ctx) {
- class Info(val msg: String, val severity: Severity, val pos: SourcePosition) {
- override def toString() = "pos: " + pos + " " + msg + " " + severity
- }
- val infos = new mutable.LinkedHashSet[Info]
+ val infos = new mutable.ListBuffer[Diagnostic]
- protected def report(msg: String, severity: Severity, pos: SourcePosition)(implicit ctx: Context): Unit = {
- infos += new Info(msg, severity, pos)
- }
+ protected def doReport(d: Diagnostic)(implicit ctx: Context): Unit =
+ infos += d
+
+ def replay(implicit ctx: Context) =
+ infos foreach ctx.reporter.report
- override def reset() {
- super.reset()
- infos.clear()
- }
}