10000 Name boolean arguments by retronym · Pull Request #2164 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

Name boolean arguments #2164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/CompileSocket.scala
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class CompileSocket extends CompileOutputCommon {
catch { case _: NumberFormatException => None }

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

Expand Down
8 changes: 4 additions & 4 deletions src/compiler/scala/tools/nsc/CompilerCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
}

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

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

settings.processArguments(expandedArguments, true)
settings.processArguments(expandedArguments, processAll = true)
}
}
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/GenericRunnerCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extends CompilerCommand(args, settings) {
// change CompilerCommand behavior
override def shouldProcessArguments: Boolean = false

private lazy val (_ok, targetAndArguments) = settings.processArguments(args, false)
private lazy val (_ok, targetAndArguments) = settings.processArguments(args, processAll = false)
override def ok = _ok
private def guessHowToRun(target: String): GenericRunnerCommand.HowToRun = {
if (!ok) Error
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/scala/tools/nsc/Global.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1418,10 +1418,10 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
}
}
if (settings.Xshowcls.isSetByUser)
showDef(splitClassAndPhase(settings.Xshowcls.value, false), false, globalPhase)
showDef(splitClassAndPhase(settings.Xshowcls.value, term = false), declsOnly = false, globalPhase)

if (settings.Xshowobj.isSetByUser)
showDef(splitClassAndPhase(settings.Xshowobj.value, true), false, globalPhase)
showDef(splitClassAndPhase(settings.Xshowobj.value, term = true), declsOnly = false, globalPhase)
}

// Similarly, this will only be created under -Yshow-syms.
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/OfflineCompilerCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class OfflineCompilerCommand(arguments: List[String], settings: FscSettings) ext

override def cmdName = "fsc"
override def usageMsg = (
createUsageMsg("where possible fsc", false, x => x.isStandard && settings.isFscSpecific(x.name)) +
createUsageMsg("where possible fsc", shouldExplain = false, x => x.isStandard && settings.isFscSpecific(x.name)) +
"\n\nStandard scalac options also available:" +
createUsageMsg(x => x.isStandard && !settings.isFscSpecific(x.name))
)
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/ScalaDoc.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ object ScalaDoc extends ScalaDoc {
class Command(arguments: List[String], settings: doc.Settings) extends CompilerCommand(arguments, settings) {
override def cmdName = "scaladoc"
override def usageMsg = (
createUsageMsg("where possible scaladoc", false, x => x.isStandard && settings.isScaladocSpecific(x.name)) +
createUsageMsg("where possible scaladoc", shouldExplain = false, x => x.isStandard && settings.isScaladocSpecific(x.name)) +
"\n\nStandard scalac options also available:" +
createUsageMsg(x => x.isStandard && !settings.isScaladocSpecific(x.name))
)
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/ast/DocComments.scala
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ trait DocComments { self: Global =>
cleanupSectionText(parent.substring(sectionTextBounds._1, sectionTextBounds._2))
case None =>
reporter.info(sym.pos, "The \"" + getSectionHeader + "\" annotation of the " + sym +
" comment contains @inheritdoc, but the corresponding section in the parent is not defined.", true)
" comment contains @inheritdoc, but the corresponding section in the parent is not defined.", force = true)
"<invalid inheritdoc annotation>"
}

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/ast/Printers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ trait Printers extends scala.reflect.internal.Printers { this: Global =>
case Select(qualifier, name) =>
printTree(qualifier)
print(".")
print(quotedName(name, true))
print(quotedName(name, decode = true))

// target.toString() ==> target.toString
case Apply(fn, Nil) => printTree(fn)
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ abstract class TreeBrowsers {
_setExpansionState(root, new TreePath(root.getModel.getRoot))
}

def expandAll(subtree: JTree) = setExpansionState(subtree, true)
def collapseAll(subtree: JTree) = setExpansionState(subtree, false)
def expandAll(subtree: JTree) = setExpansionState(subtree, expand = true)
def collapseAll(subtree: JTree) = setExpansionState(subtree, expand = false)


/** Create a frame that displays the AST.
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/scala/tools/nsc/ast/TreeDSL.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ trait TreeDSL {
* See ticket #2168 for one illustration of AS vs. AS_ANY.
*/
def AS(tpe: Type) = gen.mkAsInstanceOf(target, tpe, any = true, wrapInApply = false)
def IS(tpe: Type) = gen.mkIsInstanceOf(target, tpe, true)
def IS_OBJ(tpe: Type) = gen.mkIsInstanceOf(target, tpe, false)
def IS(tpe: Type) = gen.mkIsInstanceOf(target, tpe, any = true)
def IS_OBJ(tpe: Type) = gen.mkIsInstanceOf(target, tpe, any = false)

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

/** Typed trees from symbols. */
def THIS(sym: Symbol) = gen.mkAttributedThis(sym)
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ trait MarkupParsers {
val (qname, attrMap) = xTag(())
if (ch == '/') { // empty element
xToken("/>")
handle.element(r2p(start, start, curOffset), qname, attrMap, true, new ListBuffer[Tree])
handle.element(r2p(start, start, curOffset), qname, attrMap, empty = true, new ListBuffer[Tree])
}
else { // handle content
xToken('>')
Expand All @@ -270,7 +270,7 @@ trait MarkupParsers {
val pos = r2p(start, start, curOffset)
qname match {
case "xml:group" => handle.group(pos, ts)
case _ => handle.element(pos, qname, attrMap, false, ts)
case _ => handle.element(pos, qname, attrMap, empty = false, ts)
}
}
}
Expand Down
Loading
0