Permalink
Browse files

SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlag

This commit shortens expressions of the form `if (settings.debug.value)` to
`if (settings.debug)` for various settings.  Rarely, the setting is supplied
as a method argument.  The conversion is not employed in simple definitions
where the Boolean type would have to be specified.
  • Loading branch information...
1 parent e073975 commit 22944e474e038f11ac110661eb7e5edbea5d6d13 @som-snytt som-snytt committed with paulp Mar 26, 2013
Showing with 244 additions and 244 deletions.
  1. +3 −3 src/compiler/scala/reflect/macros/runtime/Reifiers.scala
  2. +1 −1 src/compiler/scala/reflect/reify/Phases.scala
  3. +2 −2 src/compiler/scala/reflect/reify/Reifier.scala
  4. +2 −2 src/compiler/scala/tools/nsc/CompileClient.scala
  5. +1 −1 src/compiler/scala/tools/nsc/Driver.scala
  6. +21 −21 src/compiler/scala/tools/nsc/Global.scala
  7. +1 −1 src/compiler/scala/tools/nsc/Main.scala
  8. +1 −1 src/compiler/scala/tools/nsc/MainTokenMetric.scala
  9. +2 −2 src/compiler/scala/tools/nsc/ScriptRunner.scala
  10. +4 −4 src/compiler/scala/tools/nsc/ast/NodePrinters.scala
  11. +1 −1 src/compiler/scala/tools/nsc/ast/Positions.scala
  12. +3 −3 src/compiler/scala/tools/nsc/ast/Printers.scala
  13. +1 −1 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
  14. +3 −3 src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
  15. +1 −1 src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala
  16. +3 −3 src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala
  17. +6 −6 src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
  18. +2 −2 src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala
  19. +1 −1 src/compiler/scala/tools/nsc/backend/icode/ICodes.scala
  20. +1 −1 src/compiler/scala/tools/nsc/backend/icode/Members.scala
  21. +1 −1 src/compiler/scala/tools/nsc/backend/icode/Printers.scala
  22. +1 −1 src/compiler/scala/tools/nsc/backend/icode/Repository.scala
  23. +1 −1 src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala
  24. +1 −1 src/compiler/scala/tools/nsc/backend/icode/analysis/Liveness.scala
  25. +2 −2 src/compiler/scala/tools/nsc/backend/icode/analysis/ReachingDefinitions.scala
  26. +3 −3 src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala
  27. +8 −8 src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
  28. +1 −1 src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala
  29. +1 −1 src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala
  30. +1 −1 src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala
  31. +1 −1 src/compiler/scala/tools/nsc/backend/opt/InlineExceptionHandlers.scala
  32. +4 −4 src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
  33. +1 −1 src/compiler/scala/tools/nsc/plugins/Plugins.scala
  34. +1 −1 src/compiler/scala/tools/nsc/reporters/AbstractReporter.scala
  35. +3 −3 src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
  36. +1 −1 src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala
  37. +7 −7 src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
  38. +2 −2 src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
  39. +2 −2 src/compiler/scala/tools/nsc/transform/CleanUp.scala
  40. +4 −4 src/compiler/scala/tools/nsc/transform/Erasure.scala
  41. +3 −3 src/compiler/scala/tools/nsc/transform/Mixin.scala
  42. +2 −2 src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
  43. +1 −1 src/compiler/scala/tools/nsc/transform/UnCurry.scala
  44. +1 −1 src/compiler/scala/tools/nsc/transform/patmat/MatchTreeMaking.scala
  45. +3 −3 src/compiler/scala/tools/nsc/typechecker/Adaptations.scala
  46. +2 −2 src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
  47. +1 −1 src/compiler/scala/tools/nsc/typechecker/Checkable.scala
  48. +2 −2 src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
  49. +5 −5 src/compiler/scala/tools/nsc/typechecker/Contexts.scala
  50. +1 −1 src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala
  51. +4 −4 src/compiler/scala/tools/nsc/typechecker/Implicits.scala
  52. +3 −3 src/compiler/scala/tools/nsc/typechecker/Infer.scala
  53. +2 −2 src/compiler/scala/tools/nsc/typechecker/Namers.scala
  54. +9 −9 src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
  55. +3 −3 src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
  56. +2 −2 src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
  57. +3 −3 src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala
  58. +2 −2 src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
  59. +1 −1 src/compiler/scala/tools/nsc/typechecker/TypeStrings.scala
  60. +16 −16 src/compiler/scala/tools/nsc/typechecker/Typers.scala
  61. +8 −8 src/compiler/scala/tools/reflect/ToolBoxFactory.scala
  62. +2 −2 src/compiler/scala/tools/util/PathResolver.scala
  63. +1 −1 src/interactive/scala/tools/nsc/interactive/Global.scala
  64. +1 −1 src/interactive/scala/tools/nsc/interactive/Main.scala
  65. +2 −2 src/interactive/scala/tools/nsc/interactive/REPL.scala
  66. +2 −2 src/interactive/scala/tools/nsc/interactive/tests/Tester.scala
  67. +2 −2 src/reflect/scala/reflect/internal/Kinds.scala
  68. +1 −1 src/reflect/scala/reflect/internal/Mirrors.scala
  69. +1 −1 src/reflect/scala/reflect/internal/Positions.scala
  70. +2 −2 src/reflect/scala/reflect/internal/Printers.scala
  71. +2 −2 src/reflect/scala/reflect/internal/SymbolTable.scala
  72. +3 −3 src/reflect/scala/reflect/internal/Symbols.scala
  73. +16 −16 src/reflect/scala/reflect/internal/Types.scala
  74. +1 −1 src/reflect/scala/reflect/internal/tpe/GlbLubs.scala
  75. +1 −1 src/reflect/scala/reflect/internal/tpe/TypeComparers.scala
  76. +1 −1 src/reflect/scala/reflect/internal/tpe/TypeConstraints.scala
  77. +1 −1 src/reflect/scala/reflect/internal/tpe/TypeToStrings.scala
  78. +1 −1 src/reflect/scala/reflect/runtime/JavaMirrors.scala
  79. +2 −2 src/reflect/scala/reflect/runtime/SymbolTable.scala
  80. +2 −2 src/repl/scala/tools/nsc/MainGenericRunner.scala
  81. +2 −2 src/repl/scala/tools/nsc/interpreter/ILoop.scala
  82. +1 −1 src/repl/scala/tools/nsc/interpreter/IMain.scala
  83. +1 −1 src/repl/scala/tools/nsc/interpreter/Power.scala
  84. +1 −1 src/scaladoc/scala/tools/nsc/doc/DocFactory.scala
  85. +1 −1 src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala
  86. +2 −2 src/scaladoc/scala/tools/nsc/doc/Uncompilable.scala
  87. +1 −1 src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala
  88. +2 −2 src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DiagramStats.scala
  89. +1 −1 src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala
  90. +4 −4 src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala
  91. +1 −1 src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala
  92. +2 −2 src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryTypeSupport.scala
  93. +1 −1 src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala
@@ -60,15 +60,15 @@ trait Reifiers {
def logFreeVars(symtab: SymbolTable): Unit =
// logging free vars only when they are untyped prevents avalanches of duplicate messages
symtab.syms map (sym => symtab.symDef(sym)) foreach {
- case FreeTermDef(_, _, binding, _, origin) if universe.settings.logFreeTerms.value && binding.tpe == null =>
+ case FreeTermDef(_, _, binding, _, origin) if universe.settings.logFreeTerms && binding.tpe == null =>
reporter.echo(position, "free term: %s %s".format(showRaw(binding), origin))
- case FreeTypeDef(_, _, binding, _, origin) if universe.settings.logFreeTypes.value && binding.tpe == null =>
+ case FreeTypeDef(_, _, binding, _, origin) if universe.settings.logFreeTypes && binding.tpe == null =>
reporter.echo(position, "free type: %s %s".format(showRaw(binding), origin))
case _ =>
// do nothing
}
- if (universe.settings.logFreeTerms.value || universe.settings.logFreeTypes.value)
+ if (universe.settings.logFreeTerms || universe.settings.logFreeTypes)
reification match {
case ReifiedTree(_, _, symtab, _, _, _, _) => logFreeVars(symtab)
case ReifiedType(_, _, symtab, _, _, _) => logFreeVars(symtab)
@@ -25,7 +25,7 @@ trait Phases extends Reshape
if (reifyDebug) println("[reshape phase]")
tree = reshape.transform(tree)
if (reifyDebug) println("[interlude]")
- if (reifyDebug) println("reifee = " + (if (settings.Xshowtrees.value || settings.XshowtreesCompact.value || settings.XshowtreesStringified.value) "\n" + nodePrinters.nodeToString(tree).trim else tree.toString))
+ if (reifyDebug) println("reifee = " + (if (settings.Xshowtrees || settings.XshowtreesCompact || settings.XshowtreesStringified) "\n" + nodePrinters.nodeToString(tree).trim else tree.toString))
if (reifyDebug) println("[calculate phase]")
calculate.traverse(tree)
@@ -57,7 +57,7 @@ abstract class Reifier extends States
val result = reifee match {
case tree: Tree =>
- reifyTrace("reifying = ")(if (settings.Xshowtrees.value || settings.XshowtreesCompact.value || settings.XshowtreesStringified.value) "\n" + nodePrinters.nodeToString(tree).trim else tree.toString)
+ reifyTrace("reifying = ")(if (settings.Xshowtrees || settings.XshowtreesCompact || settings.XshowtreesStringified) "\n" + nodePrinters.nodeToString(tree).trim else tree.toString)
reifyTrace("reifee is located at: ")(tree.pos)
reifyTrace("universe = ")(universe)
reifyTrace("mirror = ")(mirror)
@@ -140,4 +140,4 @@ abstract class Reifier extends States
throw new UnexpectedReificationException(defaultErrorPosition, "reification crashed", ex)
}
}
-}
+}
@@ -26,12 +26,12 @@ class StandardCompileClient extends HasCompileSocket with CompileOutputCommon {
val settings = new FscSettings(Console.println)
val command = new OfflineCompilerCommand(args.toList, settings)
val shutdown = settings.shutdown.value
- val extraVmArgs = if (settings.preferIPv4.value) List("-D%s=true".format(preferIPv4Stack.key)) else Nil
+ val extraVmArgs = if (settings.preferIPv4) List("-D%s=true".format(preferIPv4Stack.key)) else Nil
val vmArgs = settings.jvmargs.unparse ++ settings.defines.unparse ++ extraVmArgs
val fscArgs = args.toList ++ command.extraFscArgs
- if (settings.version.value) {
+ if (settings.version) {
Console println versionMsg
return true
}
@@ -41,7 +41,7 @@ abstract class Driver {
command = new CompilerCommand(args.toList, ss)
settings = command.settings
- if (settings.version.value) {
+ if (settings.version) {
reporter.echo(versionMsg)
} else if (processSettingsHook()) {
val compiler = newCompiler()
@@ -221,7 +221,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
def inform(msg: String) = reporter.echo(msg)
override def globalError(msg: String) = reporter.error(NoPosition, msg)
override def warning(msg: String) =
- if (settings.fatalWarnings.value) globalError(msg)
+ if (settings.fatalWarnings) globalError(msg)
else reporter.warning(NoPosition, msg)
// Getting in front of Predef's asserts to supplement with more info.
@@ -252,7 +252,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
}
@inline final def ifDebug(body: => Unit) {
- if (settings.debug.value)
+ if (settings.debug)
body
}
/** This is for WARNINGS which should reach the ears of scala developers
@@ -262,7 +262,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
* to make them visually distinct.
*/
@inline final override def devWarning(msg: => String) {
- if (settings.developer.value || settings.debug.value)
+ if (settings.developer || settings.debug)
warning("!!! " + msg)
else
log("!!! " + msg) // such warnings always at least logged
@@ -272,7 +272,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
msg + " in " + (currentTime - start) + "ms"
def informComplete(msg: String): Unit = reporter.withoutTruncating(inform(msg))
- def informProgress(msg: String) = if (settings.verbose.value) inform("[" + msg + "]")
+ def informProgress(msg: String) = if (settings.verbose) inform("[" + msg + "]")
def informTime(msg: String, start: Long) = informProgress(elapsedMessage(msg, start))
def logError(msg: String, t: Throwable): Unit = ()
@@ -287,7 +287,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
}
@inline final override def debuglog(msg: => String) {
- if (settings.debug.value)
+ if (settings.debug)
log(msg)
}
@@ -332,7 +332,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
}
}
- if (settings.verbose.value || settings.Ylogcp.value) {
+ if (settings.verbose || settings.Ylogcp) {
// Uses the "do not truncate" inform
informComplete("[search path for source files: " + classPath.sourcepaths.mkString(",") + "]")
informComplete("[search path for class files: " + classPath.asClasspathString + "]")
@@ -402,7 +402,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
if ((unit ne null) && unit.exists)
lastSeenSourceFile = unit.source
- if (settings.debug.value && (settings.verbose.value || currentRun.size < 5))
+ if (settings.debug && (settings.verbose || currentRun.size < 5))
inform("[running phase " + name + " on " + unit + "]")
val unit0 = currentUnit
@@ -736,7 +736,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
val maxName = (0 /: phaseNames)(_ max _.length)
val width = maxName min Limit
val maxDesc = MaxCol - (width + 6) // descriptions not novels
- val fmt = if (settings.verbose.value) s"%${maxName}s %2s %s%n"
+ val fmt = if (settings.verbose) s"%${maxName}s %2s %s%n"
else s"%${width}.${width}s %2s %.${maxDesc}s%n"
val line1 = fmt.format("phase name", "id", "description")
@@ -1097,7 +1097,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
val info3: List[String] = (
( List("== Enclosing template or block ==", nodePrinters.nodeToString(enclosing).trim) )
++ ( if (tpe eq null) Nil else List("== Expanded type of tree ==", typeDeconstruct.show(tpe)) )
- ++ ( if (!settings.debug.value) Nil else List("== Current unit body ==", nodePrinters.nodeToString(currentUnit.body)) )
+ ++ ( if (!settings.debug) Nil else List("== Current unit body ==", nodePrinters.nodeToString(currentUnit.body)) )
++ ( List(errorMessage) )
)
@@ -1113,18 +1113,18 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
def echoPhaseSummary(ph: Phase) = {
/* Only output a summary message under debug if we aren't echoing each file. */
- if (settings.debug.value && !(settings.verbose.value || currentRun.size < 5))
+ if (settings.debug && !(settings.verbose || currentRun.size < 5))
inform("[running phase " + ph.name + " on " + currentRun.size + " compilation units]")
}
/** Collects for certain classes of warnings during this run. */
class ConditionalWarning(what: String, option: Settings#BooleanSetting) {
val warnings = mutable.LinkedHashMap[Position, String]()
def warn(pos: Position, msg: String) =
- if (option.value) reporter.warning(pos, msg)
+ if (option) reporter.warning(pos, msg)
else if (!(warnings contains pos)) warnings += ((pos, msg))
def summarize() =
- if (warnings.nonEmpty && (option.isDefault || settings.fatalWarnings.value))
+ if (warnings.nonEmpty && (option.isDefault || settings.fatalWarnings))
warning("there were %d %s warning(s); re-run with %s for details".format(warnings.size, what, option.name))
}
@@ -1240,7 +1240,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
def resetProjectClasses(root: Symbol): Unit = try {
def unlink(sym: Symbol) =
if (sym != NoSymbol) root.info.decls.unlink(sym)
- if (settings.verbose.value) inform("[reset] recursing in "+root)
+ if (settings.verbose) inform("[reset] recursing in "+root)
val toReload = mutable.Set[String]()
for (sym <- root.info.decls) {
if (sym.isInitialized && clearOnNextRun(sym))
@@ -1260,7 +1260,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
for (fullname <- toReload)
classPath.findClass(fullname) match {
case Some(classRep) =>
- if (settings.verbose.value) inform("[reset] reinit "+fullname)
+ if (settings.verbose) inform("[reset] reinit "+fullname)
loaders.initializeFromClassPath(root, classRep)
case _ =>
}
@@ -1453,7 +1453,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
}
def reportCompileErrors() {
- if (!reporter.hasErrors && reporter.hasWarnings && settings.fatalWarnings.value)
+ if (!reporter.hasErrors && reporter.hasWarnings && settings.fatalWarnings)
globalError("No warnings can be incurred under -Xfatal-warnings.")
if (reporter.hasErrors) {
@@ -1492,7 +1492,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
def compileUnits(units: List[CompilationUnit], fromPhase: Phase) {
try compileUnitsInternal(units, fromPhase)
catch { case ex: Throwable =>
- val shown = if (settings.verbose.value)
+ val shown = if (settings.verbose)
stackTraceString(ex)
else
stackTraceHeadString(ex) // note that error stacktraces do not print in fsc
@@ -1526,14 +1526,14 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
if (shouldWriteIcode) {
// Write *.icode files when -Xprint-icode or -Xprint:<some-optimiz-phase> was given.
writeICode()
- } else if ((settings.Xprint containsPhase globalPhase) || settings.printLate.value && runIsAt(cleanupPhase)) {
+ } else if ((settings.Xprint containsPhase globalPhase) || settings.printLate && runIsAt(cleanupPhase)) {
// print trees
- if (settings.Xshowtrees.value || settings.XshowtreesCompact.value || settings.XshowtreesStringified.value) nodePrinters.printAll()
+ if (settings.Xshowtrees || settings.XshowtreesCompact || settings.XshowtreesStringified) nodePrinters.printAll()
else printAllUnits()
}
// print the symbols presently attached to AST nodes
- if (settings.Yshowsyms.value)
+ if (settings.Yshowsyms)
trackerFactory.snapshot()
// print members
@@ -1552,7 +1552,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
runCheckers()
// output collected statistics
- if (settings.Ystatistics.value)
+ if (settings.Ystatistics)
statistics.print(phase)
advancePhase()
@@ -1697,7 +1697,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
informProgress("wrote " + file)
} catch {
case ex: IOException =>
- if (settings.debug.value) ex.printStackTrace()
+ if (settings.debug) ex.printStackTrace()
globalError("could not write file " + file)
}
})
@@ -17,7 +17,7 @@ class MainClass extends Driver with EvalLoop {
override def newCompiler(): Global = Global(settings, reporter)
override def doCompile(compiler: Global) {
- if (settings.resident.value) resident(compiler)
+ if (settings.resident) resident(compiler)
else super.doCompile(compiler)
}
}
@@ -42,7 +42,7 @@ object MainTokenMetric {
tokenMetric(compiler, command.files)
} catch {
case ex @ FatalError(msg) =>
- if (command.settings.debug.value)
+ if (command.settings.debug)
ex.printStackTrace()
reporter.error(null, "fatal error: " + msg)
}
@@ -95,7 +95,7 @@ class ScriptRunner extends HasCompileSocket {
settings.outdir.value = compiledPath.path
- if (settings.nc.value) {
+ if (settings.nc) {
/* Setting settings.script.value informs the compiler this is not a
* self contained compilation unit.
*/
@@ -114,7 +114,7 @@ class ScriptRunner extends HasCompileSocket {
* not take place until there are no non-daemon threads running. Tickets #1955, #2006.
*/
util.waitingForThreads {
- if (settings.save.value) {
+ if (settings.save) {
val jarFile = jarFileFor(scriptFile)
def jarOK = jarFile.canRead && (jarFile isFresher File(scriptFile))
@@ -32,7 +32,7 @@ abstract class NodePrinters {
}
trait DefaultPrintAST extends PrintAST {
- val printPos = settings.Xprintpos.value || settings.Yposdebug.value
+ val printPos = settings.Xprintpos || settings.Yposdebug
def showNameAndPos(tree: NameTree) = showPosition(tree) + showName(tree.name)
def showDefTreeName(tree: DefTree) = showName(tree.name)
@@ -100,9 +100,9 @@ abstract class NodePrinters {
def stringify(tree: Tree): String = {
buf.clear()
- if (settings.XshowtreesStringified.value) buf.append(tree.toString + EOL)
- if (settings.XshowtreesCompact.value) {
- buf.append(showRaw(tree, printIds = settings.uniqid.value, printTypes = settings.printtypes.value))
+ if (settings.XshowtreesStringified) buf.append(tree.toString + EOL)
+ if (settings.XshowtreesCompact) {
+ buf.append(showRaw(tree, printIds = settings.uniqid, printTypes = settings.printtypes))
} else {
level = 0
traverse(tree)
@@ -25,6 +25,6 @@ trait Positions extends scala.reflect.internal.Positions {
}
override protected[this] lazy val posAssigner: PosAssigner =
- if (settings.Yrangepos.value && settings.debug.value || settings.Yposdebug.value) new ValidatingPosAssigner
+ if (settings.Yrangepos && settings.debug || settings.Yposdebug) new ValidatingPosAssigner
else new DefaultPosAssigner
}
@@ -200,15 +200,15 @@ trait Printers extends scala.reflect.internal.Printers { this: Global =>
override def printTree(tree: Tree) { print(safe(tree)) }
}
- def asString(t: Tree): String = render(t, newStandardTreePrinter, settings.printtypes.value, settings.uniqid.value, settings.Yshowsymkinds.value)
- def asCompactString(t: Tree): String = render(t, newCompactTreePrinter, settings.printtypes.value, settings.uniqid.value, settings.Yshowsymkinds.value)
+ def asString(t: Tree): String = render(t, newStandardTreePrinter, settings.printtypes, settings.uniqid, settings.Yshowsymkinds)
+ def asCompactString(t: Tree): String = render(t, newCompactTreePrinter, settings.printtypes, settings.uniqid, settings.Yshowsymkinds)
def asCompactDebugString(t: Tree): String = render(t, newCompactTreePrinter, true, true, true)
def newStandardTreePrinter(writer: PrintWriter): TreePrinter = new TreePrinter(writer)
def newCompactTreePrinter(writer: PrintWriter): CompactTreePrinter = new CompactTreePrinter(writer)
override def newTreePrinter(writer: PrintWriter): TreePrinter =
- if (settings.Ycompacttrees.value) newCompactTreePrinter(writer)
+ if (settings.Ycompacttrees) newCompactTreePrinter(writer)
else newStandardTreePrinter(writer)
override def newTreePrinter(stream: OutputStream): TreePrinter = newTreePrinter(new PrintWriter(stream))
override def newTreePrinter(): TreePrinter = newTreePrinter(new PrintWriter(ConsoleWriter))
@@ -2085,7 +2085,7 @@ self =>
val name = ident()
var bynamemod = 0
val tpt =
- if (settings.YmethodInfer.value && !owner.isTypeName && in.token != COLON) {
+ if (settings.YmethodInfer && !owner.isTypeName && in.token != COLON) {
TypeTree()
} else { // XX-METHOD-INFER
accept(COLON)
@@ -446,7 +446,7 @@ trait Scanners extends ScannersCommon {
* there a realistic situation where one would need it?
*/
if (isDigit(ch)) {
- if (settings.future.value) syntaxError("Non-zero numbers may not have a leading zero.")
+ if (settings.future) syntaxError("Non-zero numbers may not have a leading zero.")
else deprecationWarning("Treating numbers with a leading zero as octal is deprecated.")
}
base = 8
@@ -990,7 +990,7 @@ trait Scanners extends ScannersCommon {
/* As of scala 2.11, it isn't a number unless c here is a digit, so
* settings.future.value excludes the rest of the logic.
*/
- if (settings.future.value && !isDigit(c))
+ if (settings.future && !isDigit(c))
return setStrVal()
val isDefinitelyNumber = (c: @switch) match {
@@ -1217,7 +1217,7 @@ trait Scanners extends ScannersCommon {
*/
class SourceFileScanner(val source: SourceFile) extends Scanner {
val buf = source.content
- override val decodeUni: Boolean = !settings.nouescape.value
+ override val decodeUni: Boolean = !settings.nouescape
// suppress warnings, throw exception on errors
def deprecationWarning(off: Offset, msg: String): Unit = ()
@@ -32,7 +32,7 @@ abstract class SyntaxAnalyzer extends SubComponent with Parsers with MarkupParse
else newUnitParser(unit).smartParse()
}
- if (settings.Yrangepos.value && !reporter.hasErrors)
+ if (settings.Yrangepos && !reporter.hasErrors)
validatePositions(unit.body)
}
}
@@ -331,7 +331,7 @@ trait BasicBlocks {
assert(!closed || ignore, this)
if (ignore) {
- if (settings.debug.value) {
+ if (settings.debug) {
/* Trying to pin down what it's likely to see after a block has been
* put into ignore mode so we hear about it if there's a problem.
*/
@@ -405,11 +405,11 @@ trait BasicBlocks {
* is discovered to be unreachable.
*/
def killIf(cond: Boolean) {
- if (!settings.YdisableUnreachablePrevention.value && cond) {
+ if (!settings.YdisableUnreachablePrevention && cond) {
debuglog(s"Killing block $this")
assert(instructionList.isEmpty, s"Killing a non empty block $this")
// only checked under debug because fetching predecessor list is moderately expensive
- if (settings.debug.value)
+ if (settings.debug)
assert(predecessors.isEmpty, s"Killing block $this which is referred to from ${predecessors.mkString}")
close()
Oops, something went wrong.

0 comments on commit 22944e4

Please sign in to comment.