Browse files

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)
  • Loading branch information...
1 parent c434138 commit fff0f50773b45690d571852b139bd6da7b6a45ae @retronym retronym committed with paulp Feb 24, 2013
Showing with 302 additions and 302 deletions.
  1. +1 −1 src/compiler/scala/tools/nsc/CompileSocket.scala
  2. +4 −4 src/compiler/scala/tools/nsc/CompilerCommand.scala
  3. +1 −1 src/compiler/scala/tools/nsc/GenericRunnerCommand.scala
  4. +2 −2 src/compiler/scala/tools/nsc/Global.scala
  5. +1 −1 src/compiler/scala/tools/nsc/OfflineCompilerCommand.scala
  6. +1 −1 src/compiler/scala/tools/nsc/ScalaDoc.scala
  7. +1 −1 src/compiler/scala/tools/nsc/ast/DocComments.scala
  8. +1 −1 src/compiler/scala/tools/nsc/ast/Printers.scala
  9. +2 −2 src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
  10. +3 −3 src/compiler/scala/tools/nsc/ast/TreeDSL.scala
  11. +2 −2 src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala
  12. +35 −35 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
  13. +4 −4 src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
  14. +3 −3 src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala
  15. +7 −7 src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala
  16. +6 −6 src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
  17. +5 −5 src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala
  18. +4 −4 src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala
  19. +1 −1 src/compiler/scala/tools/nsc/backend/icode/analysis/DataFlowAnalysis.scala
  20. +5 −5 src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
  21. +3 −3 src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala
  22. +3 −3 src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
  23. +3 −3 src/compiler/scala/tools/nsc/dependencies/Changes.scala
  24. +1 −1 src/compiler/scala/tools/nsc/doc/DocFactory.scala
  25. +14 −14 src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala
  26. +1 −1 src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala
  27. +13 −13 src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala
  28. +16 −16 src/compiler/scala/tools/nsc/doc/html/page/Template.scala
  29. +1 −1 src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala
  30. +1 −1 src/compiler/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala
  31. +2 −2 src/compiler/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala
  32. +5 −5 src/compiler/scala/tools/nsc/interactive/Global.scala
  33. +1 −1 src/compiler/scala/tools/nsc/interactive/REPL.scala
  34. +1 −1 src/compiler/scala/tools/nsc/interactive/ScratchPadMaker.scala
  35. +1 −1 src/compiler/scala/tools/nsc/interactive/tests/Tester.scala
  36. +3 −3 src/compiler/scala/tools/nsc/interpreter/AbstractFileClassLoader.scala
  37. +10 −10 src/compiler/scala/tools/nsc/interpreter/ILoop.scala
  38. +2 −2 src/compiler/scala/tools/nsc/interpreter/IMain.scala
  39. +2 −2 src/compiler/scala/tools/nsc/interpreter/LoopCommands.scala
  40. +5 −5 src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala
  41. +1 −1 src/compiler/scala/tools/nsc/io/Jar.scala
  42. +1 −1 src/compiler/scala/tools/nsc/io/SourceReader.scala
  43. +6 −6 src/compiler/scala/tools/nsc/javac/JavaParsers.scala
  44. +2 −2 src/compiler/scala/tools/nsc/javac/JavaScanners.scala
  45. +4 −4 src/compiler/scala/tools/nsc/reporters/Reporter.scala
  46. +7 −7 src/compiler/scala/tools/nsc/settings/MutableSettings.scala
  47. +9 −9 src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
  48. +22 −22 src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
  49. +1 −1 src/compiler/scala/tools/nsc/transform/Erasure.scala
  50. +4 −4 src/compiler/scala/tools/nsc/transform/Mixin.scala
  51. +1 −1 src/compiler/scala/tools/nsc/transform/TailCalls.scala
  52. +1 −1 src/compiler/scala/tools/nsc/transform/TypingTransformers.scala
  53. +7 −7 src/compiler/scala/tools/nsc/transform/UnCurry.scala
  54. +2 −2 src/compiler/scala/tools/nsc/transform/patmat/Logic.scala
  55. +1 −1 src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala
  56. +1 −1 src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala
  57. +3 −3 src/compiler/scala/tools/nsc/typechecker/Contexts.scala
  58. +1 −1 src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala
  59. +7 −7 src/compiler/scala/tools/nsc/typechecker/Implicits.scala
  60. +6 −6 src/compiler/scala/tools/nsc/typechecker/Infer.scala
  61. +1 −1 src/compiler/scala/tools/nsc/typechecker/Namers.scala
  62. +5 −5 src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
  63. +5 −5 src/compiler/scala/tools/nsc/typechecker/Tags.scala
  64. +3 −3 src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
  65. +12 −12 src/compiler/scala/tools/nsc/typechecker/Typers.scala
  66. +5 −5 src/compiler/scala/tools/nsc/util/ClassPath.scala
  67. +2 −2 src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala
  68. +1 −1 src/compiler/scala/tools/reflect/package.scala
  69. +3 −3 src/compiler/scala/tools/util/Javap.scala
  70. +1 −1 src/compiler/scala/tools/util/PathResolver.scala
View
2 src/compiler/scala/tools/nsc/CompileSocket.scala
@@ -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)
View
8 src/compiler/scala/tools/nsc/CompilerCommand.scala
@@ -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.
@@ -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)
}
}
View
2 src/compiler/scala/tools/nsc/GenericRunnerCommand.scala
@@ -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
View
4 src/compiler/scala/tools/nsc/Global.scala
@@ -1421,10 +1421,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.
View
2 src/compiler/scala/tools/nsc/OfflineCompilerCommand.scala
@@ -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))
)
View
2 src/compiler/scala/tools/nsc/ScalaDoc.scala
@@ -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))
)
View
2 src/compiler/scala/tools/nsc/ast/DocComments.scala
@@ -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>"
}
View
2 src/compiler/scala/tools/nsc/ast/Printers.scala
@@ -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)
View
4 src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
@@ -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.
View
6 src/compiler/scala/tools/nsc/ast/TreeDSL.scala
@@ -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)
@@ -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)
View
4 src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala
@@ -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('>')
@@ -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)
}
}
}
View
70 src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -424,13 +424,13 @@ self =>
placeholderParams match {
case vd :: _ =>
- syntaxError(vd.pos, "unbound placeholder parameter", false)
+ syntaxError(vd.pos, "unbound placeholder parameter", skipIt = false)
placeholderParams = List()
case _ =>
}
placeholderTypes match {
case td :: _ =>
- syntaxError(td.pos, "unbound wildcard type", false)
+ syntaxError(td.pos, "unbound wildcard type", skipIt = false)
placeholderTypes = List()
case _ =>
}
@@ -537,7 +537,7 @@ self =>
def accept(token: Int): Int = {
val offset = in.offset
if (in.token != token) {
- syntaxErrorOrIncomplete(expectedMsg(token), false)
+ syntaxErrorOrIncomplete(expectedMsg(token), skipIt = false)
if ((token == RPAREN || token == RBRACE || token == RBRACKET))
if (in.parenBalance(token) + assumedClosingParens(token) < 0)
assumedClosingParens(token) += 1
@@ -570,9 +570,9 @@ self =>
/** Check that type parameter is not by name or repeated. */
def checkNotByNameOrVarargs(tpt: Tree) = {
if (treeInfo isByNameParamType tpt)
- syntaxError(tpt.pos, "no by-name parameter type allowed here", false)
+ syntaxError(tpt.pos, "no by-name parameter type allowed here", skipIt = false)
else if (treeInfo isRepeatedParamType tpt)
- syntaxError(tpt.pos, "no * parameter type allowed here", false)
+ syntaxError(tpt.pos, "no * parameter type allowed here", skipIt = false)
}
/** Check that tree is a legal clause of a forSome. */
@@ -581,7 +581,7 @@ self =>
ValDef(_, _, _, EmptyTree) | EmptyTree =>
;
case _ =>
- syntaxError(t.pos, "not a legal existential clause", false)
+ syntaxError(t.pos, "not a legal existential clause", skipIt = false)
}
/* -------------- TOKEN CLASSES ------------------------------------------- */
@@ -706,15 +706,15 @@ self =>
removeAsPlaceholder(name)
makeParam(name.toTermName, tpe)
case _ =>
- syntaxError(tree.pos, "not a legal formal parameter", false)
+ syntaxError(tree.pos, "not a legal formal parameter", skipIt = false)
makeParam(nme.ERROR, errorTypeTree setPos o2p(tree.pos.endOrPoint))
}
}
/** Convert (qual)ident to type identifier. */
def convertToTypeId(tree: Tree): Tree = atPos(tree.pos) {
convertToTypeName(tree) getOrElse {
- syntaxError(tree.pos, "identifier expected", false)
+ syntaxError(tree.pos, "identifier expected", skipIt = false)
errorTypeTree
}
}
@@ -766,7 +766,7 @@ self =>
def checkAssoc(offset: Int, op: Name, leftAssoc: Boolean) =
if (treeInfo.isLeftAssoc(op) != leftAssoc)
syntaxError(
- offset, "left- and right-associative operators with same precedence may not be mixed", false)
+ offset, "left- and right-associative operators with same precedence may not be mixed", skipIt = false)
def reduceStack(isExpr: Boolean, base: List[OpInfo], top0: Tree, prec: Int, leftAssoc: Boolean): Tree = {
var top = top0
@@ -1119,7 +1119,7 @@ self =>
case FALSE => false
case NULL => null
case _ =>
- syntaxErrorOrIncomplete("illegal literal", true)
+ syntaxErrorOrIncomplete("illegal literal", skipIt = true)
null
})
}
@@ -1140,7 +1140,7 @@ self =>
else if(in.token == LBRACE) expr()
else if(in.token == THIS) { in.nextToken(); atPos(in.offset)(This(tpnme.EMPTY)) }
else {
- syntaxErrorOrIncomplete("error in interpolated string: identifier or block expected", true)
+ syntaxErrorOrIncomplete("error in interpolated string: identifier or block expected", skipIt = true)
EmptyTree
}
}
@@ -1376,7 +1376,7 @@ self =>
Typed(t, atPos(uscorePos) { Ident(tpnme.WILDCARD_STAR) })
}
} else {
- syntaxErrorOrIncomplete("`*' expected", true)
+ syntaxErrorOrIncomplete("`*' expected", skipIt = true)
}
} else if (in.token == AT) {
t = (t /: annotations(skipNewLines = false))(makeAnnotated)
@@ -1532,7 +1532,7 @@ self =>
val cpos = r2p(tstart, tstart, in.lastOffset max tstart)
makeNew(parents, self, stats, npos, cpos)
case _ =>
- syntaxErrorOrIncomplete("illegal start of simple expression", true)
+ syntaxErrorOrIncomplete("illegal start of simple expression", skipIt = true)
errorTermTree
}
simpleExprRest(t, canApply = canApply)
@@ -1873,7 +1873,7 @@ self =>
def simplePattern(): Tree = {
// simple diagnostics for this entry point
def badStart(): Tree = {
- syntaxErrorOrIncomplete("illegal start of simple pattern", true)
+ syntaxErrorOrIncomplete("illegal start of simple pattern", skipIt = true)
errorPatternTree
}
simplePattern(badStart)
@@ -1966,7 +1966,7 @@ self =>
mods
private def addMod(mods: Modifiers, mod: Long, pos: Position): Modifiers = {
- if (mods hasFlag mod) syntaxError(in.offset, "repeated modifier", false)
+ if (mods hasFlag mod) syntaxError(in.offset, "repeated modifier", skipIt = false)
in.nextToken()
(mods | mod) withPosition (mod, pos)
}
@@ -1983,7 +1983,7 @@ self =>
if (in.token == LBRACKET) {
in.nextToken()
if (mods.hasAccessBoundary)
- syntaxError("duplicate private/protected qualifier", false)
+ syntaxError("duplicate private/protected qualifier", skipIt = false)
result = if (in.token == THIS) { in.nextToken(); mods | Flags.LOCAL }
else Modifiers(mods.flags, identForType())
accept(RBRACKET)
@@ -2090,7 +2090,7 @@ self =>
var mods = Modifiers(Flags.PARAM)
if (owner.isTypeName) {
mods = modifiers() | Flags.PARAMACCESSOR
- if (mods.isLazy) syntaxError("lazy modifier not allowed here. Use call-by-name parameters instead", false)
+ if (mods.isLazy) syntaxError("lazy modifier not allowed here. Use call-by-name parameters instead", skipIt = false)
in.token match {
case v @ (VAL | VAR) =>
mods = mods withPosition (in.token, tokenRange(in))
@@ -2115,11 +2115,11 @@ self =>
syntaxError(
in.offset,
(if (mods.isMutable) "`var'" else "`val'") +
- " parameters may not be call-by-name", false)
+ " parameters may not be call-by-name", skipIt = false)
else if (implicitmod != 0)
syntaxError(
in.offset,
- "implicit parameters may not be call-by-name", false)
+ "implicit parameters may not be call-by-name", skipIt = false)
else bynamemod = Flags.BYNAMEPARAM
}
paramType()
@@ -2160,9 +2160,9 @@ self =>
val result = vds.toList
if (owner == nme.CONSTRUCTOR && (result.isEmpty || (result.head take 1 exists (_.mods.isImplicit)))) {
in.token match {
- case LBRACKET => syntaxError(in.offset, "no type parameters allowed here", false)
+ case LBRACKET => syntaxError(in.offset, "no type parameters allowed here", skipIt = false)
case EOF => incompleteInputError("auxiliary constructor needs non-implicit parameter list")
- case _ => syntaxError(start, "auxiliary constructor needs non-implicit parameter list", false)
+ case _ => syntaxError(start, "auxiliary constructor needs non-implicit parameter list", skipIt = false)
}
}
addEvidenceParams(owner, result, contextBounds)
@@ -2373,7 +2373,7 @@ self =>
*/
def defOrDcl(pos: Int, mods: Modifiers): List[Tree] = {
if (mods.isLazy && in.token != VAL)
- syntaxError("lazy not allowed here. Only vals can be lazy", false)
+ syntaxError("lazy not allowed here. Only vals can be lazy", skipIt = false)
in.token match {
case VAL =>
patDefOrDcl(pos, mods withPosition(VAL, tokenRange(in)))
@@ -2431,8 +2431,8 @@ self =>
if (newmods.isDeferred) {
trees match {
case List(ValDef(_, _, _, EmptyTree)) =>
- if (mods.isLazy) syntaxError(p.pos, "lazy values may not be abstract", false)
- case _ => syntaxError(p.pos, "pattern definition may not be abstract", false)
+ if (mods.isLazy) syntaxError(p.pos, "lazy values may not be abstract", skipIt = false)
+ case _ => syntaxError(p.pos, "pattern definition may not be abstract", skipIt = false)
}
}
trees
@@ -2598,7 +2598,7 @@ self =>
case SUPERTYPE | SUBTYPE | SEMI | NEWLINE | NEWLINES | COMMA | RBRACE =>
TypeDef(mods | Flags.DEFERRED, name, tparams, typeBounds())
case _ =>
- syntaxErrorOrIncomplete("`=', `>:', or `<:' expected", true)
+ syntaxErrorOrIncomplete("`=', `>:', or `<:' expected", skipIt = true)
EmptyTree
}
}
@@ -2619,7 +2619,7 @@ self =>
* }}}
*/
def tmplDef(pos: Int, mods: Modifiers): Tree = {
- if (mods.isLazy) syntaxError("classes cannot be lazy", false)
+ if (mods.isLazy) syntaxError("classes cannot be lazy", skipIt = false)
in.token match {
case TRAIT =>
classDef(pos, (mods | Flags.TRAIT | Flags.ABSTRACT) withPosition (Flags.TRAIT, tokenRange(in)))
@@ -2632,7 +2632,7 @@ self =>
case CASEOBJECT =>
objectDef(pos, (mods | Flags.CASE) withPosition (Flags.CASE, tokenRange(in.prev /*scanner skips on 'case' to 'object', thus take prev*/)))
case _ =>
- syntaxErrorOrIncomplete("expected start of definition", true)
+ syntaxErrorOrIncomplete("expected start of definition", skipIt = true)
EmptyTree
}
}
@@ -2654,7 +2654,7 @@ self =>
classContextBounds = contextBoundBuf.toList
val tstart = (in.offset :: classContextBounds.map(_.pos.startOrPoint)).min
if (!classContextBounds.isEmpty && mods.isTrait) {
- syntaxError("traits cannot have type parameters with context bounds `: ...' nor view bounds `<% ...'", false)
+ syntaxError("traits cannot have type parameters with context bounds `: ...' nor view bounds `<% ...'", skipIt = false)
classContextBounds = List()
}
val constrAnnots = constructorAnnotations()
@@ -2665,7 +2665,7 @@ self =>
if (mods.isTrait) {
if (settings.YvirtClasses && in.token == SUBTYPE) mods1 |= Flags.DEFERRED
} else if (in.token == SUBTYPE) {
- syntaxError("classes are not allowed to be virtual", false)
+ syntaxError("classes are not allowed to be virtual", skipIt = false)
}
val template = templateOpt(mods1, name, constrMods withAnnotations constrAnnots, vparamss, tstart)
if (isInterface(mods1, template.body)) mods1 |= Flags.INTERFACE
@@ -2732,7 +2732,7 @@ self =>
case tdef @ TypeDef(mods, name, tparams, rhs) =>
List(treeCopy.TypeDef(tdef, mods | Flags.PRESUPER, name, tparams, rhs))
case stat if !stat.isEmpty =>
- syntaxError(stat.pos, "only type definitions and concrete field definitions allowed in early object initialization section", false)
+ syntaxError(stat.pos, "only type definitions and concrete field definitions allowed in early object initialization section", skipIt = false)
List()
case _ => List()
}
@@ -2811,7 +2811,7 @@ self =>
templateBody(isPre = false)
} else {
if (in.token == LPAREN) {
- if (parenMeansSyntaxError) syntaxError(s"traits or objects may not have parameters", true)
+ if (parenMeansSyntaxError) syntaxError(s"traits or objects may not have parameters", skipIt = true)
else abort("unexpected opening parenthesis")
}
(emptyValDef, List())
@@ -2895,7 +2895,7 @@ self =>
joinComment(List(topLevelTmplDef))
case _ =>
if (!isStatSep)
- syntaxErrorOrIncomplete("expected class or object definition", true)
+ syntaxErrorOrIncomplete("expected class or object definition", skipIt = true)
Nil
})
acceptStatSepOpt()
@@ -2954,7 +2954,7 @@ self =>
} else if (isDefIntro || isModifier || in.token == AT) {
stats ++= joinComment(nonLocalDefOrDcl)
} else if (!isStatSep) {
- syntaxErrorOrIncomplete("illegal start of definition", true)
+ syntaxErrorOrIncomplete("illegal start of definition", skipIt = true)
}
acceptStatSepOpt()
}
@@ -2977,7 +2977,7 @@ self =>
syntaxErrorOrIncomplete(
"illegal start of declaration"+
(if (inFunReturnType) " (possible cause: missing `=' in front of current method body)"
- else ""), true)
+ else ""), skipIt = true)
}
if (in.token != RBRACE) acceptStatSep()
}
@@ -3047,7 +3047,7 @@ self =>
}
else {
val addendum = if (isModifier) " (no modifiers allowed here)" else ""
- syntaxErrorOrIncomplete("illegal start of statement" + addendum, true)
+ syntaxErrorOrIncomplete("illegal start of statement" + addendum, skipIt = true)
}
}
stats.toList
View
8 src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
@@ -915,7 +915,7 @@ trait Scanners extends ScannersCommon {
}
}
- def intVal: Long = intVal(false)
+ def intVal: Long = intVal(negated = false)
/** Convert current strVal, base to double value
*/
@@ -947,7 +947,7 @@ trait Scanners extends ScannersCommon {
}
}
- def floatVal: Double = floatVal(false)
+ def floatVal: Double = floatVal(negated = false)
def checkNoLetter() {
if (isIdentifierPart(ch) && ch >= ' ')
@@ -1440,7 +1440,7 @@ trait Scanners extends ScannersCommon {
while (lin < lineStart.length && column(lineStart(lin)) > lindent)
lin += 1
if (lin < lineStart.length) {
- val patches1 = insertPatch(patches, BracePatch(lineStart(lin), true))
+ val patches1 = insertPatch(patches, BracePatch(lineStart(lin), inserted = true))
//println("patch for "+bp+"/"+imbalanceMeasure+"/"+new ParensAnalyzer(unit, patches1).imbalanceMeasure)
/*if (improves(patches1))*/
patches1
@@ -1461,7 +1461,7 @@ trait Scanners extends ScannersCommon {
else {
val patches1 = delete(nested)
if (patches1 ne patches) patches1
- else insertPatch(patches, BracePatch(roff, false))
+ else insertPatch(patches, BracePatch(roff, inserted = false))
}
}
delete(bracePairs)
View
6 src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala
@@ -132,7 +132,7 @@ abstract class SymbolicXMLBuilder(p: Parsers#Parser, preserveWS: Boolean) {
case (Some(pre), rest) => (const(pre), const(rest))
case _ => (wild, const(n))
}
- mkXML(pos, true, prepat, labpat, null, null, false, args)
+ mkXML(pos, isPattern = true, prepat, labpat, null, null, empty = false, args)
}
protected def convertToTextPat(t: Tree): Tree = t match {
@@ -168,7 +168,7 @@ abstract class SymbolicXMLBuilder(p: Parsers#Parser, preserveWS: Boolean) {
}
/** Returns (Some(prefix) | None, rest) based on position of ':' */
- def splitPrefix(name: String): (Option[String], String) = splitWhere(name, _ == ':', true) match {
+ def splitPrefix(name: String): (Option[String], String) = splitWhere(name, _ == ':', doDropIndex = true) match {
case Some((pre, rest)) => (Some(pre), rest)
case _ => (None, name)
}
@@ -246,7 +246,7 @@ abstract class SymbolicXMLBuilder(p: Parsers#Parser, preserveWS: Boolean) {
val body = mkXML(
pos.makeTransparent,
- false,
+ isPattern = false,
const(pre),
const(newlabel),
makeSymbolicAttrs,
View
14 src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala
@@ -133,7 +133,7 @@ abstract class TreeBuilder {
def makeTupleTerm(trees: List[Tree], flattenUnary: Boolean): Tree = trees match {
case Nil => Literal(Constant())
case List(tree) if flattenUnary => tree
- case _ => makeTuple(trees, false)
+ case _ => makeTuple(trees, isType = false)
}
def makeTupleType(trees: List[Tree], flattenUnary: Boolean): Tree = trees match {
@@ -143,7 +143,7 @@ abstract class TreeBuilder {
}
def stripParens(t: Tree) = t match {
- case Parens(ts) => atPos(t.pos) { makeTupleTerm(ts, true) }
+ case Parens(ts) => atPos(t.pos) { makeTupleTerm(ts, flattenUnary = true) }
case _ => t
}
@@ -273,7 +273,7 @@ abstract class TreeBuilder {
CaseDef(condition, EmptyTree, Literal(Constant(true))),
CaseDef(Ident(nme.WILDCARD), EmptyTree, Literal(Constant(false)))
)
- val matchTree = makeVisitor(cases, false, scrutineeName)
+ val matchTree = makeVisitor(cases, checkExhaustive = false, scrutineeName)
atPos(tree.pos)(Apply(Select(tree, nme.withFilter), matchTree :: Nil))
}
@@ -366,7 +366,7 @@ abstract class TreeBuilder {
body) setPos splitpos
case None =>
atPos(splitpos) {
- makeVisitor(List(CaseDef(pat, EmptyTree, body)), false)
+ makeVisitor(List(CaseDef(pat, EmptyTree, body)), checkExhaustive = false)
}
}
}
@@ -422,9 +422,9 @@ abstract class TreeBuilder {
val ids = (defpat1 :: defpats) map makeValue
val rhs1 = makeForYield(
List(ValFrom(pos, defpat1, rhs)),
- Block(pdefs, atPos(wrappingPos(ids)) { makeTupleTerm(ids, true) }) setPos wrappingPos(pdefs))
+ Block(pdefs, atPos(wrappingPos(ids)) { makeTupleTerm(ids, flattenUnary = true) }) setPos wrappingPos(pdefs))
val allpats = (pat :: pats) map (_.duplicate)
- val vfrom1 = ValFrom(r2p(pos.startOrPoint, pos.point, rhs1.pos.endOrPoint), atPos(wrappingPos(allpats)) { makeTuple(allpats, false) } , rhs1)
+ val vfrom1 = ValFrom(r2p(pos.startOrPoint, pos.point, rhs1.pos.endOrPoint), atPos(wrappingPos(allpats)) { makeTuple(allpats, isType = false) } , rhs1)
makeFor(mapName, flatMapName, vfrom1 :: rest1, body)
case _ =>
EmptyTree //may happen for erroneous input
@@ -533,7 +533,7 @@ abstract class TreeBuilder {
rhs1,
List(
atPos(pat1.pos) {
- CaseDef(pat1, EmptyTree, makeTupleTerm(vars map (_._1) map Ident.apply, true))
+ CaseDef(pat1, EmptyTree, makeTupleTerm(vars map (_._1) map Ident.apply, flattenUnary = true))
}
))
}
View
12 src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
@@ -688,7 +688,7 @@ abstract class GenICode extends SubComponent {
ctx.bb.emit(DUP(generatedType))
val ctx1 = genLoadArguments(args, ctor.info.paramTypes, ctx)
- val init = CALL_METHOD(ctor, Static(true))
+ val init = CALL_METHOD(ctor, Static(onInstance = true))
nw.init = init
ctx1.bb.emit(init, tree.pos)
ctx1
@@ -760,9 +760,9 @@ abstract class GenICode extends SubComponent {
debuglog("Gen CALL_METHOD with sym: " + sym + " isStaticSymbol: " + sym.isStaticMember)
val invokeStyle =
if (sym.isStaticMember)
- Static(false)
+ Static(onInstance = false)
else if (sym.isPrivate || sym.isClassConstructor)
- Static(true)
+ Static(onInstance = true)
else
Dynamic
@@ -1261,7 +1261,7 @@ abstract class GenICode extends SubComponent {
case List(Literal(Constant("")), arg) =>
debuglog("Rewriting \"\" + x as String.valueOf(x) for: " + arg)
val ctx1 = genLoad(arg, ctx, ObjectReference)
- ctx1.bb.emit(CALL_METHOD(String_valueOf, Static(false)), arg.pos)
+ ctx1.bb.emit(CALL_METHOD(String_valueOf, Static(onInstance = false)), arg.pos)
ctx1
case concatenations =>
debuglog("Lifted string concatenations for " + tree + "\n to: " + concatenations)
@@ -1286,7 +1286,7 @@ abstract class GenICode extends SubComponent {
}
val ctx1 = genLoad(tree, ctx, ObjectReference)
- ctx1.bb.emit(CALL_METHOD(hashMethod, Static(false)))
+ ctx1.bb.emit(CALL_METHOD(hashMethod, Static(onInstance = false)))
ctx1
}
@@ -1477,7 +1477,7 @@ abstract class GenICode extends SubComponent {
val ctx1 = genLoad(l, ctx, ObjectReference)
val ctx2 = genLoad(r, ctx1, ObjectReference)
ctx2.bb.emitOnly(
- CALL_METHOD(equalsMethod, if (settings.optimise.value) Dynamic else Static(false)),
+ CALL_METHOD(equalsMethod, if (settings.optimise.value) Dynamic else Static(onInstance = false)),
CZJUMP(thenCtx.bb, elseCtx.bb, NE, BOOL)
)
}
View
10 src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala
@@ -119,11 +119,11 @@ abstract class ICodeCheckers {
clasz = cls
for (f1 <- cls.fields ; f2 <- cls.fields ; if f1 < f2)
- if (isConfict(f1, f2, false))
+ if (isConfict(f1, f2, canOverload = false))
icodeError("Repetitive field name: " + f1.symbol.fullName)
for (m1 <- cls.methods ; m2 <- cls.methods ; if m1 < m2)
- if (isConfict(m1, m2, true))
+ if (isConfict(m1, m2, canOverload = true))
icodeError("Repetitive method: " + m1.symbol.fullName)
clasz.methods foreach check
@@ -321,14 +321,14 @@ abstract class ICodeCheckers {
def popStackN(num: Int, instrFn: () => String = defaultInstrPrinter) = {
List.range(0, num) map { _ =>
val res = _popStack
- printStackString(false, res, instrFn())
+ printStackString(isPush = false, res, instrFn())
res
}
}
def pushStackN(xs: Seq[TypeKind], instrFn: () => String) = {
xs foreach { x =>
stack push x
- printStackString(true, x, instrFn())
+ printStackString(isPush = true, x, instrFn())
}
}
@@ -594,7 +594,7 @@ abstract class ICodeCheckers {
case x if style.hasInstance => x + 1
case x => x
}
- if (style == Static(true))
+ if (style == Static(onInstance = true))
checkBool(method.isPrivate || method.isConstructor, "Static call to non-private method.")
checkStack(paramCount)
View
8 src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala
@@ -308,7 +308,7 @@ abstract class CopyPropagation {
case CALL_METHOD(method, style) => style match {
case Dynamic =>
- out = simulateCall(in, method, false)
+ out = simulateCall(in, method, static = false)
case Static(onInstance) =>
if (onInstance) {
@@ -326,12 +326,12 @@ abstract class CopyPropagation {
// put the Record back on the stack and remove the 'returned' value
out.stack = out.stack.drop(1 + method.info.paramTypes.length)
} else
- out = simulateCall(in, method, false)
+ out = simulateCall(in, method, static = false)
} else
- out = simulateCall(in, method, true)
+ out = simulateCall(in, method, static = true)
case SuperCall(_) =>
- out = simulateCall(in, method, false)
+ out = simulateCall(in, method, static = false)
}
case BOX(tpe) =>
View
2 src/compiler/scala/tools/nsc/backend/icode/analysis/DataFlowAnalysis.scala
@@ -79,7 +79,7 @@ trait DataFlowAnalysis[L <: SemiLattice] {
val point = worklist.head
worklist -= point
- out(point) = lattice.lub(point.successors map in.apply, false) // TODO check for exception handlers
+ out(point) = lattice.lub(point.successors map in.apply, exceptional = false) // TODO check for exception handlers
val input = f(point, out(point))
if ((lattice.bottom == in(point)) || input != in(point)) {
View
10 src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
@@ -1155,8 +1155,8 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
)
val methodSymbol = definitions.getMember(clasz.symbol.companionModule, androidFieldName)
clasz addField new IField(fieldSymbol)
- block emit CALL_METHOD(methodSymbol, Static(false))
- block emit STORE_FIELD(fieldSymbol, true)
+ block emit CALL_METHOD(methodSymbol, Static(onInstance = false))
+ block emit STORE_FIELD(fieldSymbol, isStatic = true)
}
def legacyAddCreatorCode(clinit: asm.MethodVisitor) {
@@ -1613,19 +1613,19 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
if (isStaticModule(clasz.symbol)) {
// call object's private ctor from static ctor
lastBlock emit NEW(REFERENCE(m.symbol.enclClass))
- lastBlock emit CALL_METHOD(m.symbol.enclClass.primaryConstructor, Static(true))
+ lastBlock emit CALL_METHOD(m.symbol.enclClass.primaryConstructor, Static(onInstance = true))
}
if (isParcelableClass) { addCreatorCode(lastBlock) }
lastBlock emit RETURN(UNIT)
lastBlock.close()
- method = m
+ method = m
jmethod = clinitMethod
jMethodName = CLASS_CONSTRUCTOR_NAME
jmethod.visitCode()
- genCode(m, false, true)
+ genCode(m, emitVars = false, isStatic = true)
jmethod.visitMaxs(0, 0) // just to follow protocol, dummy arguments
jmethod.visitEnd()
View
6 src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala
@@ -114,7 +114,7 @@ abstract class DeadCodeElimination extends SubComponent {
for (Pair(i, idx) <- bb.toList.zipWithIndex) {
// utility for adding to worklist
- def moveToWorkList() = moveToWorkListIf(true)
+ def moveToWorkList() = moveToWorkListIf(cond = true)
// utility for (conditionally) adding to worklist
def moveToWorkListIf(cond: Boolean) =
@@ -130,7 +130,7 @@ abstract class DeadCodeElimination extends SubComponent {
case LOAD_LOCAL(_) =>
defs = defs + Pair(((bb, idx)), rd.vars)
- moveToWorkListIf(false)
+ moveToWorkListIf(cond = false)
case STORE_LOCAL(l) =>
/* SI-4935 Check whether a module is stack top, if so mark the instruction that loaded it
@@ -184,7 +184,7 @@ abstract class DeadCodeElimination extends SubComponent {
case LOAD_MODULE(sym) if isLoadNeeded(sym) =>
moveToWorkList() // SI-4859 Module initialization might side-effect.
case _ => ()
- moveToWorkListIf(false)
+ moveToWorkListIf(cond = false)
}
rd = rdef.interpret(bb, idx, rd)
}
View
6 src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
@@ -480,8 +480,8 @@ abstract class Inliners extends SubComponent {
* so that the first TFA that is run afterwards is able to gain more information as compared to a cold-start.
*/
/*val totalPreInlines = */ { // Val name commented out to emphasize it is never used
- val firstRound = preInline(true)
- if(firstRound == 0) 0 else (firstRound + preInline(false))
+ val firstRound = preInline(isFirstRound = true)
+ if(firstRound == 0) 0 else (firstRound + preInline(isFirstRound = false))
}
staleOut.clear()
splicedBlocks.clear()
@@ -869,7 +869,7 @@ abstract class Inliners extends SubComponent {
r
case CALL_METHOD(meth, Static(true)) if meth.isClassConstructor =>
- CALL_METHOD(meth, Static(true))
+ CALL_METHOD(meth, Static(onInstance = true))
case _ => i.clone()
}
View
6 src/compiler/scala/tools/nsc/dependencies/Changes.scala
@@ -52,7 +52,7 @@ abstract class Changes {
private val changedTypeParams = new mutable.HashSet[String]
private def sameParameterSymbolNames(sym1: Symbol, sym2: Symbol): Boolean =
- sameSymbol(sym1, sym2, true) || sym2.encodedName.startsWith(sym1.encodedName + nme.NAME_JOIN_STRING) // see #3140
+ sameSymbol(sym1, sym2, simple = true) || sym2.encodedName.startsWith(sym1.encodedName + nme.NAME_JOIN_STRING) // see #3140
private def sameSymbol(sym1: Symbol, sym2: Symbol, simple: Boolean = false): Boolean =
if (simple) sym1.encodedName == sym2.encodedName else sym1.fullName == sym2.fullName
private def sameFlags(sym1: Symbol, sym2: Symbol): Boolean =
@@ -121,7 +121,7 @@ abstract class Changes {
case (NullaryMethodType(res1), NullaryMethodType(res2)) =>
sameType(res1, res2)
case (ExistentialType(tparams1, res1), ExistentialType(tparams2, res2)) =>
- sameTypeParams(tparams1, tparams2)(false) && sameType(res1, res2)(false)
+ sameTypeParams(tparams1, tparams2)(strict = false) && sameType(res1, res2)(strict = false)
case (TypeBounds(lo1, hi1), TypeBounds(lo2, hi2)) =>
sameType(lo1, lo2) && sameType(hi1, hi2)
case (BoundedWildcardType(bounds), _) =>
@@ -174,7 +174,7 @@ abstract class Changes {
if ((from.parents zip to.parents) exists { case (t1, t2) => !sameType(t1, t2) })
cs += Changed(toEntity(toSym))(from.parents.zip(to.parents).toString)
- if (!sameTypeParams(from.typeParams, to.typeParams)(false))
+ if (!sameTypeParams(from.typeParams, to.typeParams)(strict = false))
cs += Changed(toEntity(toSym))(" tparams: " + from.typeParams.zip(to.typeParams))
// new members not yet visited
View
2 src/compiler/scala/tools/nsc/doc/DocFactory.scala
@@ -94,7 +94,7 @@ class DocFactory(val reporter: Reporter, val settings: doc.Settings) { processor
val documentError: PartialFunction[Throwable, Unit] = {
case NoCompilerRunException =>
- reporter.info(null, "No documentation generated with unsucessful compiler run", false)
+ reporter.info(null, "No documentation generated with unsucessful compiler run", force = false)
case _: ClassNotFoundException =>
()
}
View
28 src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala
@@ -228,40 +228,40 @@ trait CommentFactoryBase { this: MemberLookupBase =>
case CodeBlockStartRegex(before, marker, after) :: ls if (!inCodeBlock) =>
if (!before.trim.isEmpty && !after.trim.isEmpty)
- parse0(docBody, tags, lastTagKey, before :: marker :: after :: ls, false)
+ parse0(docBody, tags, lastTagKey, before :: marker :: after :: ls, inCodeBlock = false)
else if (!before.trim.isEmpty)
- parse0(docBody, tags, lastTagKey, before :: marker :: ls, false)
+ parse0(docBody, tags, lastTagKey, before :: marker :: ls, inCodeBlock = false)
else if (!after.trim.isEmpty)
- parse0(docBody, tags, lastTagKey, marker :: after :: ls, true)
+ parse0(docBody, tags, lastTagKey, marker :: after :: ls, inCodeBlock = true)
else lastTagKey match {
case Some(key) =>
val value =
((tags get key): @unchecked) match {
case Some(b :: bs) => (b + endOfLine + marker) :: bs
case None => oops("lastTagKey set when no tag exists for key")
}
- parse0(docBody, tags + (key -> value), lastTagKey, ls, true)
+ parse0(docBody, tags + (key -> value), lastTagKey, ls, inCodeBlock = true)
case None =>
- parse0(docBody append endOfLine append marker, tags, lastTagKey, ls, true)
+ parse0(docBody append endOfLine append marker, tags, lastTagKey, ls, inCodeBlock = true)
}
case CodeBlockEndRegex(before, marker, after) :: ls =>
if (!before.trim.isEmpty && !after.trim.isEmpty)
- parse0(docBody, tags, lastTagKey, before :: marker :: after :: ls, true)
+ parse0(docBody, tags, lastTagKey, before :: marker :: after :: ls, inCodeBlock = true)
if (!before.trim.isEmpty)
- parse0(docBody, tags, lastTagKey, before :: marker :: ls, true)
+ parse0(docBody, tags, lastTagKey, before :: marker :: ls, inCodeBlock = true)
else if (!after.trim.isEmpty)
- parse0(docBody, tags, lastTagKey, marker :: after :: ls, false)
+ parse0(docBody, tags, lastTagKey, marker :: after :: ls, inCodeBlock = false)
else lastTagKey match {
case Some(key) =>
val value =
((tags get key): @unchecked) match {
case Some(b :: bs) => (b + endOfLine + marker) :: bs
case None => oops("lastTagKey set when no tag exists for key")
}
- parse0(docBody, tags + (key -> value), lastTagKey, ls, false)
+ parse0(docBody, tags + (key -> value), lastTagKey, ls, inCodeBlock = false)
case None =>
- parse0(docBody append endOfLine append marker, tags, lastTagKey, ls, false)
+ parse0(docBody append endOfLine append marker, tags, lastTagKey, ls, inCodeBlock = false)
}
case SymbolTagRegex(name, sym, body) :: ls if (!inCodeBlock) =>
@@ -375,7 +375,7 @@ trait CommentFactoryBase { this: MemberLookupBase =>
}
- parse0(new StringBuilder(comment.size), Map.empty, None, clean(comment), false)
+ parse0(new StringBuilder(comment.size), Map.empty, None, clean(comment), inCodeBlock = false)
}
@@ -451,7 +451,7 @@ trait CommentFactoryBase { this: MemberLookupBase =>
else {
jumpWhitespace()
jump(style)
- val p = Paragraph(inline(false))
+ val p = Paragraph(inline(isInlineEnd = false))
blockEnded("end of list line ")
Some(p)
}
@@ -510,11 +510,11 @@ trait CommentFactoryBase { this: MemberLookupBase =>
def para(): Block = {
val p =
if (summaryParsed)
- Paragraph(inline(false))
+ Paragraph(inline(isInlineEnd = false))
else {
val s = summary()
val r =
- if (checkParaEnded()) List(s) else List(s, inline(false))
+ if (checkParaEnded()) List(s) else List(s, inline(isInlineEnd = false))
summaryParsed = true
Paragraph(Chain(r))
}
View
2 src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala
@@ -123,7 +123,7 @@ abstract class HtmlPage extends Page { thisPage =>
case Text(text) => scala.xml.Text(text)
case Summary(in) => inlineToHtml(in)
case HtmlTag(tag) => scala.xml.Unparsed(tag)
- case EntityLink(target, link) => linkToHtml(target, link, true)
+ case EntityLink(target, link) => linkToHtml(target, link, hasLinks = true)
}
def linkToHtml(text: Inline, link: LinkTo, hasLinks: Boolean) = link match {
View
26 src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala
@@ -107,14 +107,14 @@ private[html] object SyntaxHigh {
case '/' =>
if (star) {
if (level > 0) level -= 1
- if (level == 0) i else multiline(i+1, true)
+ if (level == 0) i else multiline(i+1, star = true)
} else
- multiline(i+1, false)
+ multiline(i+1, star = false)
case _ =>
- multiline(i+1, false)
+ multiline(i+1, star = false)
}
}
- if (buf(i) == '/') line(i) else multiline(i, true)
+ if (buf(i) == '/') line(i) else multiline(i, star = true)
out.toString
}
@@ -129,16 +129,16 @@ private[html] object SyntaxHigh {
out append ch
ch match {
case '\\' =>
- charlit0(i+1, true)
+ charlit0(i+1, bslash = true)
case '\'' if !bslash =>
i
case _ =>
- if (bslash && '0' <= ch && ch <= '9') charlit0(i+1, true)
- else charlit0(i+1, false)
+ if (bslash && '0' <= ch && ch <= '9') charlit0(i+1, bslash = true)
+ else charlit0(i+1, bslash = false)
}
}
}
- charlit0(j, false)
+ charlit0(j, bslash = false)
out.toString
}
@@ -150,14 +150,14 @@ private[html] object SyntaxHigh {
out append ch
ch match {
case '\\' =>
- strlit0(i+1, true)
+ strlit0(i+1, bslash = true)
case '"' if !bslash =>
i
case _ =>
- strlit0(i+1, false)
+ strlit0(i+1, bslash = false)
}
}
- strlit0(i, false)
+ strlit0(i, bslash = false)
out.toString
}
@@ -183,7 +183,7 @@ private[html] object SyntaxHigh {
ch match {
case 'e' | 'E' =>
out append ch
- expo(i+1, false)
+ expo(i+1, signed = false)
case _ =>
if (Character.isDigit(ch)) {
out append ch
@@ -197,7 +197,7 @@ private[html] object SyntaxHigh {
ch match {
case '+' | '-' if !signed =>
out append ch
- expo(i+1, true)
+ expo(i+1, signed = true)
case _ =>
if (Character.isDigit(ch)) {
out append ch
View
32 src/compiler/scala/tools/nsc/doc/html/page/Template.scala
@@ -110,8 +110,8 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
<h1>{ displayName }</h1>
</div>
- { signature(tpl, true) }
- { memberToCommentHtml(tpl, tpl.inTemplate, true) }
+ { signature(tpl, isSelf = true) }
+ { memberToCommentHtml(tpl, tpl.inTemplate, isSelf = true) }
<div id="mbrsel">
<div id='textfilter'><span class='pre'/><span class='input'><input id='mbrsel-input' type='text' accesskey='/'/></span><span class='post'/></div>
@@ -242,7 +242,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
NodeSeq fromSeq (for (conversion <- (tpl.conversions)) yield
<div class="conversion" name={ conversion.conversionQualifiedName }>
<h3>Inherited by implicit conversion { conversion.conversionShortName } from
- { typeToHtml(tpl.resultType, true) } to { typeToHtml(conversion.targetType, true) }
+ { typeToHtml(tpl.resultType, hasLinks = true) } to { typeToHtml(conversion.targetType, hasLinks = true) }
</h3>
</div>
)
@@ -284,14 +284,14 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
}
def memberToHtml(mbr: MemberEntity, inTpl: DocTemplateEntity): NodeSeq = {
- val memberComment = memberToCommentHtml(mbr, inTpl, false)
+ val memberComment = memberToCommentHtml(mbr, inTpl, isSelf = false)
<li name={ mbr.definitionName } visbl={ if (mbr.visibility.isProtected) "prt" else "pub" }
data-isabs={ mbr.isAbstract.toString }
fullComment={ if(memberComment.filter(_.label=="div").isEmpty) "no" else "yes" }
group={ mbr.group }>
<a id={ mbr.signature }/>
<a id={ mbr.signatureCompat }/>
- { signature(mbr, false) }
+ { signature(mbr, isSelf = false) }
{ memberComment }
</li>
}
@@ -398,7 +398,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
case Some(conv) =>
<dt class="implicit">Implicit information</dt> ++
{
- val targetType = typeToHtml(conv.targetType, true)
+ val targetType = typeToHtml(conv.targetType, hasLinks = true)
val conversionMethod = conv.convertorMethod match {
case Left(member) => Text(member.name)
case Right(name) => Text(name)
@@ -424,7 +424,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
}
<dd>
- This member is added by an implicit conversion from { typeToHtml(inTpl.resultType, true) } to
+ This member is added by an implicit conversion from { typeToHtml(inTpl.resultType, hasLinks = true) } to
{ targetType } performed by method { conversionMethod } in { conversionOwner }.
{ constraintText }
</dd>
@@ -486,7 +486,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
case nte: NonTemplateMemberEntity if nte.isUseCase =>
<div class="full-signature-block toggleContainer">
<span class="toggle">Full Signature</span>
- <div class="hiddenContent full-signature-usecase">{ signature(nte.useCaseOf.get,true) }</div>
+ <div class="hiddenContent full-signature-usecase">{ signature(nte.useCaseOf.get,isSelf = true) }</div>
</div>
case _ => NodeSeq.Empty
}
@@ -923,13 +923,13 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
if (tpl.universe.settings.useStupidTypes.value)
superTpl match {
case dtpl: DocTemplateEntity =>
- val sig = signature(dtpl, false, true) \ "_"
+ val sig = signature(dtpl, isSelf = false, isReduced = true) \ "_"
sig
case tpl: TemplateEntity =>
Text(tpl.name)
}
else
- typeToHtml(superType, true)
+ typeToHtml(superType, hasLinks = true)
private def constraintToHtml(constraint: Constraint): NodeSeq = constraint match {
case ktcc: KnownTypeClassConstraint =>
@@ -941,21 +941,21 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
context-bounded</a> ++ scala.xml.Text(" by " + tcc.typeClassEntity.qualifiedName + " (" + tcc.typeParamName + ": ") ++
templateToHtml(tcc.typeClassEntity) ++ scala.xml.Text(")")
case impl: ImplicitInScopeConstraint =>
- scala.xml.Text("an implicit value of type ") ++ typeToHtml(impl.implicitType, true) ++ scala.xml.Text(" is in scope")
+ scala.xml.Text("an implicit value of type ") ++ typeToHtml(impl.implicitType, hasLinks = true) ++ scala.xml.Text(" is in scope")
case eq: EqualTypeParamConstraint =>
scala.xml.Text(eq.typeParamName + " is " + eq.rhs.name + " (" + eq.typeParamName + " =:= ") ++
- typeToHtml(eq.rhs, true) ++ scala.xml.Text(")")
+ typeToHtml(eq.rhs, hasLinks = true) ++ scala.xml.Text(")")
case bt: BoundedTypeParamConstraint =>
scala.xml.Text(bt.typeParamName + " is a superclass of " + bt.lowerBound.name + " and a subclass of " +
bt.upperBound.name + " (" + bt.typeParamName + " >: ") ++
- typeToHtml(bt.lowerBound, true) ++ scala.xml.Text(" <: ") ++
- typeToHtml(bt.upperBound, true) ++ scala.xml.Text(")")
+ typeToHtml(bt.lowerBound, hasLinks = true) ++ scala.xml.Text(" <: ") ++
+ typeToHtml(bt.upperBound, hasLinks = true) ++ scala.xml.Text(")")
case lb: LowerBoundedTypeParamConstraint =>
scala.xml.Text(lb.typeParamName + " is a superclass of " + lb.lowerBound.name + " (" + lb.typeParamName + " >: ") ++
- typeToHtml(lb.lowerBound, true) ++ scala.xml.Text(")")
+ typeToHtml(lb.lowerBound, hasLinks = true) ++ scala.xml.Text(")")
case ub: UpperBoundedTypeParamConstraint =>
scala.xml.Text(ub.typeParamName + " is a subclass of " + ub.upperBound.name + " (" + ub.typeParamName + " <: ") ++
- typeToHtml(ub.upperBound, true) ++ scala.xml.Text(")")
+ typeToHtml(ub.upperBound, hasLinks = true) ++ scala.xml.Text(")")
}
}
View
2 src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala
@@ -321,7 +321,7 @@ class DotDiagramGenerator(settings: doc.Settings) extends DiagramGenerator {
val result = if (dotOutput != null) {
val src = scala.io.Source.fromString(dotOutput)
try {
- val cpa = scala.xml.parsing.ConstructingParser.fromSource(src, false)
+ val cpa = scala.xml.parsing.ConstructingParser.fromSource(src, preserveWS = false)
val doc = cpa.document()
if (doc != null)
transform(doc.docElem)
View
2 src/compiler/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala
@@ -170,7 +170,7 @@ trait ModelFactoryImplicitSupport {
val newContext = context.makeImplicit(context.ambiguousErrors)
newContext.macrosEnabled = false
val newTyper = global.analyzer.newTyper(newContext)
- newTyper.silent(_.typed(appliedTree, EXPRmode, WildcardType), false) match {
+ newTyper.silent(_.typed(appliedTree, EXPRmode, WildcardType), reportAmbiguousErrors = false) match {
case global.analyzer.SilentResultValue(t: Tree) => t
case global.analyzer.SilentTypeError(err) =>
View
4 src/compiler/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala
@@ -63,7 +63,7 @@ trait DiagramDirectiveParser {
NoDiagramAtAll
if (template.comment.isDefined)
- makeDiagramFilter(template, template.comment.get.inheritDiagram, defaultFilter, true)
+ makeDiagramFilter(template, template.comment.get.inheritDiagram, defaultFilter, isInheritanceDiagram = true)
else
defaultFilter
}
@@ -72,7 +72,7 @@ trait DiagramDirectiveParser {
def makeContentDiagramFilter(template: DocTemplateImpl): DiagramFilter = {
val defaultFilter = if (template.isPackage || template.isObject) FullDiagram else NoDiagramAtAll
if (template.comment.isDefined)
- makeDiagramFilter(template, template.comment.get.contentDiagram, defaultFilter, false)
+ makeDiagramFilter(template, template.comment.get.contentDiagram, defaultFilter, isInheritanceDiagram = false)
else
defaultFilter
}
View
10 src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -746,10 +746,10 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
try {
val tp1 = pre.memberType(alt) onTypeError NoType
val tp2 = adaptToNewRunMap(sym.tpe) substSym (originalTypeParams, sym.owner.typeParams)
- matchesType(tp1, tp2, false) || {
+ matchesType(tp1, tp2, alwaysMatchSimple = false) || {
debugLog(s"findMirrorSymbol matchesType($tp1, $tp2) failed")
val tp3 = adaptToNewRunMap(sym.tpe) substSym (originalTypeParams, alt.owner.typeParams)
- matchesType(tp1, tp3, false) || {
+ matchesType(tp1, tp3, alwaysMatchSimple = false) || {
debugLog(s"findMirrorSymbol fallback matchesType($tp1, $tp3) failed")
false
}
@@ -909,8 +909,8 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
val locals = new Members[ScopeMember]
val enclosing = new Members[ScopeMember]
def addScopeMember(sym: Symbol, pre: Type, viaImport: Tree) =
- locals.add(sym, pre, false) { (s, st) =>
- new ScopeMember(s, st, context.isAccessible(s, pre, false), viaImport)
+ locals.add(sym, pre, implicitlyAdded = false) { (s, st) =>
+ new ScopeMember(s, st, context.isAccessible(s, pre, superAccess = false), viaImport)
}
def localsToEnclosing() = {
enclosing.addNonShadowed(locals)
@@ -1012,7 +1012,7 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
val vtree = viewApply(view)
val vpre = stabilizedType(vtree)
for (sym <- vtree.tpe.members) {
- addTypeMember(sym, vpre, false, view.tree.symbol)
+ addTypeMember(sym, vpre, inherited = false, view.tree.symbol)
}
}
//println()
View
2 src/compiler/scala/tools/nsc/interactive/REPL.scala
@@ -107,7 +107,7 @@ object REPL {
}
def doStructure(file: String) {
- comp.askParsedEntered(toSourceFile(file), false, structureResult)
+ comp.askParsedEntered(toSourceFile(file), keepLoaded = false, structureResult)
show(structureResult)
}
View
2 src/compiler/scala/tools/nsc/interactive/ScratchPadMaker.scala
@@ -191,7 +191,7 @@ trait ScratchPadMaker { self: Global =>
* prints its output and all defined values in a comment column.
*/
protected def instrument(source: SourceFile, line: Int): (String, Array[Char]) = {
- val tree = typedTree(source, true)
+ val tree = typedTree(source, forceReload = true)
val endOffset = if (line < 0) source.length else source.lineToOffset(line + 1)
val patcher = new Patcher(source.content, new LexicalStructure(source), endOffset)
patcher.traverse(tree)
View
2 src/compiler/scala/tools/nsc/interactive/tests/Tester.scala
@@ -199,7 +199,7 @@ class Tester(ntests: Int, inputs: Array[SourceFile], settings: Settings) {
object Tester {
def main(args: Array[String]) {
val settings = new Settings()
- val (_, filenames) = settings.processArguments(args.toList.tail, true)
+ val (_, filenames) = settings.processArguments(args.toList.tail, processAll = true)
println("filenames = "+filenames)
val files = filenames.toArray map (str => new BatchSourceFile(AbstractFile.getFile(str)): SourceFile)
new Tester(args(0).toInt, files, settings).run()
View
6 src/compiler/scala/tools/nsc/interpreter/AbstractFileClassLoader.scala
@@ -28,12 +28,12 @@ class AbstractFileClassLoader(val root: AbstractFile, parent: ClassLoader)
val pathParts = name split '/'
for (dirPart <- pathParts.init) {
- file = file.lookupName(dirPart, true)
+ file = file.lookupName(dirPart, directory = true)
if (file == null)
return null
}
- file.lookupName(pathParts.last, false) match {
+ file.lookupName(pathParts.last, directory = false) match {
case null => null
case file => file
}
@@ -47,7 +47,7 @@ class AbstractFileClassLoader(val root: AbstractFile, parent: ClassLoader)
val pathParts = dirNameToPath(name) split '/'
for (dirPart <- pathParts) {
- file = file.lookupName(dirPart, true)
+ file = file.lookupName(dirPart, directory = true)
if (file == null)
return null
}
View
20 src/compiler/scala/tools/nsc/interpreter/ILoop.scala
@@ -145,7 +145,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
case Nil => echo(cmd + ": no such command. Type :help for help.")
case xs => echo(cmd + " is ambiguous: did you mean " + xs.map(":" + _.name).mkString(" or ") + "?")
}
- Result(true, None)
+ Result(keepRunning = true, None)
}
private def matchingCommands(cmd: String) = commands filter (_.name startsWith cmd)
private def uniqueCommand(cmd: String): Option[LoopCommand] = {
@@ -216,7 +216,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
cmd("load", "<path>", "load and interpret a Scala file", loadCommand),
nullary("paste", "enter paste mode: all input up to ctrl-D compiled together", pasteCommand),
nullary("power", "enable power user mode", powerCmd),
- nullary("quit", "exit the interpreter", () => Result(false, None)),
+ nullary("quit", "exit the interpreter", () => Result(keepRunning = false, None)),
nullary("replay", "reset execution and replay all previous commands", replay),
nullary("reset", "reset the repl to its initial state, forgetting all session entries", resetCommand),
shCommand,
@@ -288,8 +288,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
private def typeCommand(line0: String): Result = {
line0.trim match {
case "" => ":type [-v] <expression>"
- case s if s startsWith "-v " => intp.typeCommandInternal(s stripPrefix "-v " trim, true)
- case s => intp.typeCommandInternal(s, false)
+ case s if s startsWith "-v " => intp.typeCommandInternal(s stripPrefix "-v " trim, verbose = true)
+ case s => intp.typeCommandInternal(s, verbose = false)
}
}
@@ -403,7 +403,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
savingReader {
savingReplayStack {
file applyReader { reader =>
- in = SimpleReader(reader, out, false)
+ in = SimpleReader(reader, out, interactive = false)
echo("Loading " + file + "...")
loop()
}
@@ -467,7 +467,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
interpretAllFrom(f)
shouldReplay = Some(":load " + arg)
})
- Result(true, shouldReplay)
+ Result(keepRunning = true, shouldReplay)
}
def addClasspath(arg: String): Unit = {
@@ -483,7 +483,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
def powerCmd(): Result = {
if (isReplPower) "Already in power mode."
- else enablePowerMode(false)
+ else enablePowerMode(isDuringInit = false)
}
def enablePowerMode(isDuringInit: Boolean) = {
replProps.power setValue true
@@ -520,8 +520,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
case _ => ambiguousError(cmd)
}
}
- else if (intp.global == null) Result(false, None) // Notice failure to create compiler
- else Result(true, interpretStartingWith(line))
+ else if (intp.global == null) Result(keepRunning = false, None) // Notice failure to create compiler
+ else Result(keepRunning = true, interpretStartingWith(line))
}
private def readWhile(cond: String => Boolean) = {
@@ -668,7 +668,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
createInterpreter()
// sets in to some kind of reader depending on environmental cues
- in = in0.fold(chooseReader(settings))(r => SimpleReader(r, out, true))
+ in = in0.fold(chooseReader(settings))(r => SimpleReader(r, out, interactive = true))
globalFuture = future {
intp.initializeSynchronous()
loopPostInit()
View
4 src/compiler/scala/tools/nsc/interpreter/IMain.scala
@@ -532,8 +532,8 @@ class IMain(initialSettings: Settings, protected val out: JPrintWriter) extends
* The return value is whether the line was interpreter successfully,
* e.g. that there were no parse errors.
*/
- def interpret(line: String): IR.Result = interpret(line, false)
- def interpretSynthetic(line: String): IR.Result = interpret(line, true)
+ def interpret(line: String): IR.Result = interpret(line, synthetic = false)
+ def interpretSynthetic(line: String): IR.Result = interpret(line, synthetic = true)
def interpret(line: String, synthetic: Boolean): IR.Result = {
def loadAndRunReq(req: Request) = {
classLoader.setAsContext()
View
4 src/compiler/scala/tools/nsc/interpreter/LoopCommands.scala
@@ -39,7 +39,7 @@ trait LoopCommands {
// called if no args are given
def showUsage(): Result = {
"usage is " + usageMsg
- Result(true, None)
+ Result(keepRunning = true, None)
}
}
object LoopCommand {
@@ -72,7 +72,7 @@ trait LoopCommands {
object Result {
// the default result means "keep running, and don't record that line"
- val default = Result(true, None)
+ val default = Result(keepRunning = true, None)
// most commands do not want to micromanage the Result, but they might want
// to print something to the console, so we accomodate Unit and String returns.
View
10 src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala
@@ -30,10 +30,10 @@ trait StructuredTypeStrings extends DestructureTypes {
else elems.mkString(ldelim, mdelim, rdelim)
)
}
- val NoGrouping = Grouping("", "", "", false)
- val ListGrouping = Grouping("(", ", ", ")", false)
- val ProductGrouping = Grouping("(", ", ", ")", true)
- val BlockGrouping = Grouping(" { ", "; ", "}", false)
+ val NoGrouping = Grouping("", "", "", labels = false)
+ val ListGrouping = Grouping("(", ", ", ")", labels = false)
+ val ProductGrouping = Grouping("(", ", ", ")", labels = true)
+ val BlockGrouping = Grouping(" { ", "; ", "}", labels = false)
private def str(level: Int)(body: => String): String = " " * level + body
private def block(level: Int, grouping: Grouping)(name: String, nodes: List[TypeNode]): String = {
@@ -66,7 +66,7 @@ trait StructuredTypeStrings extends DestructureTypes {
def nodes: List[TypeNode]
def show(indent: Int, showLabel: Boolean): String = maybeBlock(indent, grouping)(mkPrefix(showLabel), nodes)
- def show(indent: Int): String = show(indent, true)
+ def show(indent: Int): String = show(indent, showLabel = true)
def show(): String = show(0)
def withLabel(l: String): this.type = modifyNameInfo(_.copy(label = l))
View
2 src/compiler/scala/tools/nsc/io/Jar.scala
@@ -159,7 +159,7 @@ object Jar {
private val ZipMagicNumber = List[Byte](80, 75, 3, 4)
private def magicNumberIsZip(f: Path) = f.isFile && (f.toFile.bytes().take(4).toList == ZipMagicNumber)
- def isJarOrZip(f: Path): Boolean = isJarOrZip(f, true)
+ def isJarOrZip(f: Path): Boolean = isJarOrZip(f, examineFile = true)
def isJarOrZip(f: Path, examineFile: Boolean): Boolean =
f.hasExtension("zip", "jar") || (examineFile && magicNumberIsZip(f))
View
2 src/compiler/scala/tools/nsc/io/SourceReader.scala
@@ -74,7 +74,7 @@ class SourceReader(decoder: CharsetDecoder, reporter: Reporter) {
protected def read(bytes: ByteBuffer): Array[Char] = {
val decoder: CharsetDecoder = this.decoder.reset()
val chars: CharBuffer = this.chars; chars.clear()
- terminate(flush(decoder, decode(decoder, bytes, chars, true)))
+ terminate(flush(decoder, decode(decoder, bytes, chars, endOfInput = true)))
}
//########################################################################
View
12 src/compiler/scala/tools/nsc/javac/JavaParsers.scala
@@ -178,7 +178,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
JavaScannerConfiguration.token2string(token) + " expected but " +
JavaScannerConfiguration.token2string(in.token) + " found."
- syntaxError(posToReport, msg, true)
+ syntaxError(posToReport, msg, skipIt = true)
}
if (in.token == token) in.nextToken()
pos
@@ -224,7 +224,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
case AppliedTypeTree(_, _) | ExistentialTypeTree(_, _) | SelectFromTypeTree(_, _) =>
tree
case _ =>
- syntaxError(tree.pos, "identifier expected", false)
+ syntaxError(tree.pos, "identifier expected", skipIt = false)
errorTypeTree
}
}
@@ -259,7 +259,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
case FLOAT => in.nextToken(); TypeTree(FloatClass.tpe)
case DOUBLE => in.nextToken(); TypeTree(DoubleClass.tpe)
case BOOLEAN => in.nextToken(); TypeTree(BooleanClass.tpe)
- case _ => syntaxError("illegal start of type", true); errorTypeTree
+ case _ => syntaxError("illegal start of type", skipIt = true); errorTypeTree
}
}
@@ -644,7 +644,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
accept(SEMI)
val names = buf.toList
if (names.length < 2) {
- syntaxError(pos, "illegal import", false)
+ syntaxError(pos, "illegal import", skipIt = false)
List()
} else {
val qual = ((Ident(names.head): Tree) /: names.tail.init) (Select(_, _))
@@ -839,7 +839,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
case INTERFACE => interfaceDecl(mods)
case AT => annotationDecl(mods)
case CLASS => classDecl(mods)
- case _ => in.nextToken(); syntaxError("illegal start of type declaration", true); List(errorTypeTree)
+ case _ => in.nextToken(); syntaxError("illegal start of type declaration", skipIt = true); List(errorTypeTree)
}
/** CompilationUnit ::= [package QualId semi] TopStatSeq
@@ -867,7 +867,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
while (in.token != EOF && in.token != RBRACE) {
while (in.token == SEMI) in.nextToken()
if (in.token != EOF)
- buf ++= typeDecl(modifiers(false))
+ buf ++= typeDecl(modifiers(inInterface = false))
}
accept(EOF)
atPos(pos) {
View
4 src/compiler/scala/tools/nsc/javac/JavaScanners.scala
@@ -63,8 +63,8 @@ trait JavaScanners extends ast.parser.ScannersCommon {
def next: AbstractJavaTokenData
def intVal(negated: Boolean): Long
def floatVal(negated: Boolean): Double
- def intVal: Long = intVal(false)
- def floatVal: Double = floatVal(false)
+ def intVal: Long = intVal(negated = false)
+ def floatVal: Double = floatVal(negated = false)
def currentPos: Position
}
View
8 src/compiler/scala/tools/nsc/reporters/Reporter.scala
@@ -58,15 +58,15 @@ abstract class Reporter {
/** For sending a message which should not be labeled as a warning/error,
* but also shouldn't require -verbose to be visible.
*/
- def echo(msg: String): Unit = info(NoPosition, msg, true)
- def echo(pos: Position, msg: String): Unit = info(pos, msg, true)
+ def echo(msg: String): Unit = info(NoPosition, msg, force = true)
+ def echo(pos: Position, msg: String): Unit = info(pos, msg, force = true)
/** Informational messages, suppressed unless -verbose or force=true. */
def info(pos: Position, msg: String, force: Boolean): Unit = info0(pos, msg, INFO, force)
/** Warnings and errors. */
- def warning(pos: Position, msg: String): Unit = withoutTruncating(info0(pos, msg, WARNING, false))
- def error(pos: Position, msg: String): Unit = withoutTruncating(info0(pos, msg, ERROR, false))
+ def warning(pos: Position, msg: String): Unit = withoutTruncating(info0(pos, msg, WARNING, force = false))
+ def error(pos: Position, msg: String): Unit = withoutTruncating(info0(pos, msg, ERROR, force = false))
def incompleteInputError(pos: Position, msg: String): Unit = {
if (incompleteHandled) incompleteHandler(pos, msg)
else error(pos, msg)
View
14 src/compiler/scala/tools/nsc/settings/MutableSettings.scala