Skip to content

Commit fff0f50

Browse files
retronympaulp
authored andcommitted
Name boolean arguments in src/compiler.
What would you prefer? adaptToMemberWithArgs(tree, qual, name, mode, false, false) Or: adaptToMemberWithArgs(tree, qual, name, mode, reportAmbiguous = false, saveErrors = false)
1 parent c434138 commit fff0f50

File tree

70 files changed

+302
-302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+302
-302
lines changed

src/compiler/scala/tools/nsc/CompileSocket.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class CompileSocket extends CompileOutputCommon {
186186
catch { case _: NumberFormatException => None }
187187

188188
def getSocket(serverAdr: String): Socket = (
189-
for ((name, portStr) <- splitWhere(serverAdr, _ == ':', true) ; port <- parseInt(portStr)) yield
189+
for ((name, portStr) <- splitWhere(serverAdr, _ == ':', doDropIndex = true) ; port <- parseInt(portStr)) yield
190190
getSocket(name, port)
191191
) getOrElse fatal("Malformed server address: %s; exiting" format serverAdr)
192192

src/compiler/scala/tools/nsc/CompilerCommand.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
7676
}
7777

7878
/** Messages explaining usage and options */
79-
def usageMsg = createUsageMsg("where possible standard", false, _.isStandard)
80-
def xusageMsg = createUsageMsg("Possible advanced", true, _.isAdvanced)
81-
def yusageMsg = createUsageMsg("Possible private", true, _.isPrivate)
79+
def usageMsg = createUsageMsg("where possible standard", shouldExplain = false, _.isStandard)
80+
def xusageMsg = createUsageMsg("Possible advanced", shouldExplain = true, _.isAdvanced)
81+
def yusageMsg = createUsageMsg("Possible private", shouldExplain = true, _.isPrivate)
8282

8383
// If any of these settings is set, the compiler shouldn't start;
8484
// an informative message of some sort should be printed instead.
@@ -122,6 +122,6 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
122122
case x => List(x)
123123
}
124124

125-
settings.processArguments(expandedArguments, true)
125+
settings.processArguments(expandedArguments, processAll = true)
126126
}
127127
}

src/compiler/scala/tools/nsc/GenericRunnerCommand.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extends CompilerCommand(args, settings) {
2626
// change CompilerCommand behavior
2727
override def shouldProcessArguments: Boolean = false
2828

29-
private lazy val (_ok, targetAndArguments) = settings.processArguments(args, false)
29+
private lazy val (_ok, targetAndArguments) = settings.processArguments(args, processAll = false)
3030
override def ok = _ok
3131
private def guessHowToRun(target: String): GenericRunnerCommand.HowToRun = {
3232
if (!ok) Error

src/compiler/scala/tools/nsc/Global.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,10 +1421,10 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
14211421
}
14221422
}
14231423
if (settings.Xshowcls.isSetByUser)
1424-
showDef(splitClassAndPhase(settings.Xshowcls.value, false), false, globalPhase)
1424+
showDef(splitClassAndPhase(settings.Xshowcls.value, term = false), declsOnly = false, globalPhase)
14251425

14261426
if (settings.Xshowobj.isSetByUser)
1427-
showDef(splitClassAndPhase(settings.Xshowobj.value, true), false, globalPhase)
1427+
showDef(splitClassAndPhase(settings.Xshowobj.value, term = true), declsOnly = false, globalPhase)
14281428
}
14291429

14301430
// Similarly, this will only be created under -Yshow-syms.

src/compiler/scala/tools/nsc/OfflineCompilerCommand.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class OfflineCompilerCommand(arguments: List[String], settings: FscSettings) ext
3939

4040
override def cmdName = "fsc"
4141
override def usageMsg = (
42-
createUsageMsg("where possible fsc", false, x => x.isStandard && settings.isFscSpecific(x.name)) +
42+
createUsageMsg("where possible fsc", shouldExplain = false, x => x.isStandard && settings.isFscSpecific(x.name)) +
4343
"\n\nStandard scalac options also available:" +
4444
createUsageMsg(x => x.isStandard && !settings.isFscSpecific(x.name))
4545
)

src/compiler/scala/tools/nsc/ScalaDoc.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ object ScalaDoc extends ScalaDoc {
6060
class Command(arguments: List[String], settings: doc.Settings) extends CompilerCommand(arguments, settings) {
6161
override def cmdName = "scaladoc"
6262
override def usageMsg = (
63-
createUsageMsg("where possible scaladoc", false, x => x.isStandard && settings.isScaladocSpecific(x.name)) +
63+
createUsageMsg("where possible scaladoc", shouldExplain = false, x => x.isStandard && settings.isScaladocSpecific(x.name)) +
6464
"\n\nStandard scalac options also available:" +
6565
createUsageMsg(x => x.isStandard && !settings.isScaladocSpecific(x.name))
6666
)

src/compiler/scala/tools/nsc/ast/DocComments.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ trait DocComments { self: Global =>
265265
cleanupSectionText(parent.substring(sectionTextBounds._1, sectionTextBounds._2))
266266
case None =>
267267
reporter.info(sym.pos, "The \"" + getSectionHeader + "\" annotation of the " + sym +
268-
" comment contains @inheritdoc, but the corresponding section in the parent is not defined.", true)
268+
" comment contains @inheritdoc, but the corresponding section in the parent is not defined.", force = true)
269269
"<invalid inheritdoc annotation>"
270270
}
271271

src/compiler/scala/tools/nsc/ast/Printers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ trait Printers extends scala.reflect.internal.Printers { this: Global =>
128128
case Select(qualifier, name) =>
129129
printTree(qualifier)
130130
print(".")
131-
print(quotedName(name, true))
131+
print(quotedName(name, decode = true))
132132

133133
// target.toString() ==> target.toString
134134
case Apply(fn, Nil) => printTree(fn)

src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ abstract class TreeBrowsers {
169169
_setExpansionState(root, new TreePath(root.getModel.getRoot))
170170
}
171171

172-
def expandAll(subtree: JTree) = setExpansionState(subtree, true)
173-
def collapseAll(subtree: JTree) = setExpansionState(subtree, false)
172+
def expandAll(subtree: JTree) = setExpansionState(subtree, expand = true)
173+
def collapseAll(subtree: JTree) = setExpansionState(subtree, expand = false)
174174

175175

176176
/** Create a frame that displays the AST.

src/compiler/scala/tools/nsc/ast/TreeDSL.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ trait TreeDSL {
116116
* See ticket #2168 for one illustration of AS vs. AS_ANY.
117117
*/
118118
def AS(tpe: Type) = gen.mkAsInstanceOf(target, tpe, any = true, wrapInApply = false)
119-
def IS(tpe: Type) = gen.mkIsInstanceOf(target, tpe, true)
120-
def IS_OBJ(tpe: Type) = gen.mkIsInstanceOf(target, tpe, false)
119+
def IS(tpe: Type) = gen.mkIsInstanceOf(target, tpe, any = true)
120+
def IS_OBJ(tpe: Type) = gen.mkIsInstanceOf(target, tpe, any = false)
121121

122122
def TOSTRING() = fn(target, nme.toString_)
123123
def GETCLASS() = fn(target, Object_getClass)
@@ -251,7 +251,7 @@ trait TreeDSL {
251251
def TRY(tree: Tree) = new TryStart(tree, Nil, EmptyTree)
252252
def BLOCK(xs: Tree*) = Block(xs.init.toList, xs.last)
253253
def NOT(tree: Tree) = Select(tree, Boolean_not)
254-
def SOME(xs: Tree*) = Apply(SomeClass.companionSymbol, makeTupleTerm(xs.toList, true))
254+
def SOME(xs: Tree*) = Apply(SomeClass.companionSymbol, makeTupleTerm(xs.toList, flattenUnary = true))
255255

256256
/** Typed trees from symbols. */
257257
def THIS(sym: Symbol) = gen.mkAttributedThis(sym)

0 commit comments

Comments
 (0)