Skip to content
Snippets Groups Projects
Commit ac07339d authored by Romain Ruetschi's avatar Romain Ruetschi :crystal_ball:
Browse files

Add override point for reporter creation

parent ec5dd7d4
No related branches found
No related tags found
1 merge request!91Add override point for reporter creation
...@@ -129,8 +129,11 @@ trait MainHelpers { ...@@ -129,8 +129,11 @@ trait MainHelpers {
val parser = { (_: String) => throw FatalError("Unparsable option \"files\"") } val parser = { (_: String) => throw FatalError("Unparsable option \"files\"") }
} }
protected def newReporter(debugSections: Set[DebugSection]): inox.Reporter =
new DefaultReporter(debugSections)
protected def processOptions(args: Seq[String]): Context = { protected def processOptions(args: Seq[String]): Context = {
val initReporter = new DefaultReporter(Set()) val initReporter = newReporter(Set())
val opts = args.filter(_.startsWith("--")) val opts = args.filter(_.startsWith("--"))
...@@ -152,7 +155,7 @@ trait MainHelpers { ...@@ -152,7 +155,7 @@ trait MainHelpers {
for ((optDef, values) <- inoxOptions.groupBy(_.optionDef) if values.size > 1) for ((optDef, values) <- inoxOptions.groupBy(_.optionDef) if values.size > 1)
initReporter.fatalError(s"Duplicate option: ${optDef.name}") initReporter.fatalError(s"Duplicate option: ${optDef.name}")
val reporter = new DefaultReporter( val reporter = newReporter(
inoxOptions.collectFirst { inoxOptions.collectFirst {
case OptionValue(`optDebug`, sections) => sections.asInstanceOf[Set[DebugSection]] case OptionValue(`optDebug`, sections) => sections.asInstanceOf[Set[DebugSection]]
}.getOrElse(Set[DebugSection]()) }.getOrElse(Set[DebugSection]())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment