From 5c7513f7e1a425978952d5389d23adce81005284 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 21 Apr 2014 23:30:58 +0200 Subject: Add support for specifying 'all' for -Xprint, -Yskip, etc --- src/dotty/tools/dotc/core/Decorators.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/core') diff --git a/src/dotty/tools/dotc/core/Decorators.scala b/src/dotty/tools/dotc/core/Decorators.scala index 25b5dbabc..155ea87e0 100644 --- a/src/dotty/tools/dotc/core/Decorators.scala +++ b/src/dotty/tools/dotc/core/Decorators.scala @@ -125,12 +125,13 @@ object Decorators { /** Implements a test whether a list of strings representing phases contains * a given phase. The test returns true if the given phase starts with - * one of the names in the list of strings. + * one of the names in the list of strings, or if the list of strings + * contains "all". */ implicit class PhaseListDecorator(val names: List[String]) extends AnyVal { def containsPhase(phase: Phase): Boolean = phase match { case phase: TreeTransformer => phase.transformations.exists(containsPhase) - case _ => names exists (phase.name.startsWith) + case _ => names exists (n => n == "all" || phase.name.startsWith(n)) } } -- cgit v1.2.3