empty filter is no filter

(cherry picked from commit 1489e59716)
This commit is contained in:
Lukas Rytz 2020-03-05 16:00:09 +01:00 committed by Dale Wijnand
parent 143ba48d6c
commit eb724b580e
2 changed files with 8 additions and 5 deletions

View File

@ -572,7 +572,7 @@ object Reporting {
if (!arg.endsWith("$")) pat += '$'
regex(pat.toString).map(SourcePattern)
} else {
Left(s"filter not yet implemented: $s")
Left(s"unknown filter: $s")
}
}

View File

@ -3796,10 +3796,13 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
val filters = (info.assocs: @unchecked) match {
case Nil => List(MessageFilter.Any)
case (_, LiteralAnnotArg(s)) :: Nil =>
val (ms, fs) = separateE(s.stringValue.split('&').map(WConf.parseFilter(_, runReporting.rootDirPrefix)).toList)
if (ms.nonEmpty)
reporter.error(info.pos, s"Invalid message filter:\n${ms.mkString("\n")}")
fs
if (s.stringValue.isEmpty) List()
else {
val (ms, fs) = separateE(s.stringValue.split('&').map(WConf.parseFilter(_, runReporting.rootDirPrefix)).toList)
if (ms.nonEmpty)
reporter.error(info.pos, s"Invalid message filter:\n${ms.mkString("\n")}")
fs
}
}
val (start, end) =
if (settings.Yrangepos) {