From d7c44086cc34eee7991753fc2ea284bdefed9670 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Thu, 9 Apr 2015 17:26:10 +0200 Subject: Add spaces around + in dotty source. --- .../tools/dotc/transform/ExtensionMethods.scala | 8 ++++---- .../tools/dotc/transform/PatternMatcher.scala | 24 +++++++++++----------- .../tools/dotc/transform/SuperAccessors.scala | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/dotty/tools/dotc/transform') diff --git a/src/dotty/tools/dotc/transform/ExtensionMethods.scala b/src/dotty/tools/dotc/transform/ExtensionMethods.scala index a006f04a7..26f26fc2f 100644 --- a/src/dotty/tools/dotc/transform/ExtensionMethods.scala +++ b/src/dotty/tools/dotc/transform/ExtensionMethods.scala @@ -88,12 +88,12 @@ class ExtensionMethods extends MiniPhaseTransform with DenotTransformer with Ful case decl: MultiDenotation => val alts = decl.alternatives val index = alts indexOf imeth.denot - assert(index >= 0, alts+" does not contain "+imeth) - def altName(index: Int) = (imeth.name+"$extension"+index).toTermName + assert(index >= 0, alts + " does not contain " + imeth) + def altName(index: Int) = (imeth.name + "$extension" + index).toTermName altName(index) #:: ((0 until alts.length).toStream filter (index != _) map altName) case decl => - assert(decl.exists, imeth.name+" not found in "+imeth.owner+"'s decls: "+imeth.owner.info.decls) - Stream((imeth.name+"$extension").toTermName) + assert(decl.exists, imeth.name + " not found in " + imeth.owner + "'s decls: " + imeth.owner.info.decls) + Stream((imeth.name + "$extension").toTermName) } } diff --git a/src/dotty/tools/dotc/transform/PatternMatcher.scala b/src/dotty/tools/dotc/transform/PatternMatcher.scala index 9dd2e1113..3e5402eb4 100644 --- a/src/dotty/tools/dotc/transform/PatternMatcher.scala +++ b/src/dotty/tools/dotc/transform/PatternMatcher.scala @@ -325,7 +325,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans private[TreeMakers] def incorporateOuterRebinding(outerSubst: Rebindings): Unit = { if (currSub ne null) { - ctx.debuglog("BUG: incorporateOuterRebinding called more than once for "+ ((this, currSub, outerSubst))) + ctx.debuglog("BUG: incorporateOuterRebinding called more than once for " + ((this, currSub, outerSubst))) Thread.dumpStack() } else currSub = outerSubst >> rebindings @@ -364,7 +364,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans def chainBefore(next: Tree)(casegen: Casegen): Tree = // assert(next eq EmptyTree) /*atPos(body.pos)*/(casegen.one(body)) // since SubstOnly treemakers are dropped, need to do it here - override def toString = "B"+((body, matchPt)) + override def toString = "B" + ((body, matchPt)) } /** @@ -532,7 +532,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans } - override def toString = "X"+((extractor, nextBinder.name)) + override def toString = "X" + ((extractor, nextBinder.name)) } /** @@ -584,7 +584,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans } } - override def toString = "P"+((prevBinder.name, extraCond getOrElse "", introducedRebindings)) + override def toString = "P" + ((prevBinder.name, extraCond getOrElse "", introducedRebindings)) } object IrrefutableExtractorTreeMaker { @@ -706,7 +706,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans case class TypeTestTreeMaker(afterTest: Symbol, testedBinder: Symbol, expectedTp: Type, nextBinderTp: Type)(override val pos: Position, extractorArgTypeTest: Boolean = false) extends CondTreeMaker { import TypeTestTreeMaker._ - ctx.debuglog("TTTM"+((prevBinder, extractorArgTypeTest, testedBinder, expectedTp, nextBinderTp))) + ctx.debuglog("TTTM" + ((prevBinder, extractorArgTypeTest, testedBinder, expectedTp, nextBinderTp))) val prevBinder = testedBinder @@ -802,7 +802,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans // dotty deviation renderCondition(nonNullImpliedByTestChecker(binder)).asInstanceOf[Boolean] - override def toString = "TT"+((expectedTp, testedBinder.name, nextBinderTp)) + override def toString = "TT" + ((expectedTp, testedBinder.name, nextBinderTp)) } // need to substitute to deal with existential types -- TODO: deal with existentials better, don't substitute (see RichClass during quick.comp) @@ -814,7 +814,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans // equals need not be well-behaved, so don't intersect with pattern's (stabilized) type (unlike MaybeBoundTyped's accumType, where it's required) val cond = codegen._equals(patTree, prevBinder) val res = ref(prevBinder).ensureConforms(nextBinderTp) - override def toString = "ET"+((prevBinder.name, patTree)) + override def toString = "ET" + ((prevBinder.name, patTree)) } case class AlternativesTreeMaker(prevBinder: Symbol, var altss: List[List[TreeMaker]], pos: Position) extends TreeMaker with NoNewBinders { @@ -843,7 +843,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans val pos = guardTree.pos def chainBefore(next: Tree)(casegen: Casegen): Tree = casegen.flatMapGuard(guardTree, next) - override def toString = "G("+ guardTree +")" + override def toString = "G(" + guardTree + ")" } // combineExtractors changes the current substitution's of the tree makers in `treeMakers` @@ -873,7 +873,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans def matchFailGen = matchFailGenOverride orElse Some((arg: Symbol) => Throw(New(defn.MatchErrorType, List(ref(arg))))) - ctx.debuglog("combining cases: "+ (casesRebindingPropagated.map(_.mkString(" >> ")).mkString("{", "\n", "}"))) + ctx.debuglog("combining cases: " + (casesRebindingPropagated.map(_.mkString(" >> ")).mkString("{", "\n", "}"))) val (suppression, requireSwitch): (Suppression, Boolean) = /*if (settings.XnoPatmatAnalysis)*/ (Suppression.NoSuppression, false) @@ -1173,7 +1173,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans /*if (phase.id >= currentRun.uncurryPhase.id) devWarning(s"running translateMatch past uncurry (at $phase) on $selector match $cases")*/ - ctx.debuglog("translating "+ cases.mkString("{", "\n", "}")) + ctx.debuglog("translating " + cases.mkString("{", "\n", "}")) //val start = if (Statistics.canEnable) Statistics.startTimer(patmatNanos) else null @@ -1240,7 +1240,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans * 2) is easy -- it looks like: `translatePattern_1.flatMap(translatePattern_2....flatMap(translatePattern_N.flatMap(translateGuard.flatMap((x_i) => success(Xbody(x_i)))))...)` * this must be right-leaning tree, as can be seen intuitively by considering the scope of bound variables: * variables bound by pat_1 must be visible from the function inside the left-most flatMap right up to Xbody all the way on the right - * 1) is tricky because translatePattern_i determines the shape of translatePattern_i+1: + * 1) is tricky because translatePattern_i determines the shape of translatePattern_i + 1: * zoom in on `translatePattern_1.flatMap(translatePattern_2)` for example -- it actually looks more like: * `translatePattern_1(x_scrut).flatMap((x_1) => {y_i -> x_1._i}translatePattern_2)` * @@ -1424,7 +1424,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans else genDrop(binder, expectedLength) ) // this error-condition has already been checked by checkStarPatOK: - // if(isSeq) assert(firstIndexingBinder + nbIndexingIndices + (if(lastIsStar) 1 else 0) == totalArity, "(resultInMonad, ts, subPatTypes, subPats)= "+(resultInMonad, ts, subPatTypes, subPats)) + // if(isSeq) assert(firstIndexingBinder + nbIndexingIndices + (if(lastIsStar) 1 else 0) == totalArity, "(resultInMonad, ts, subPatTypes, subPats)= " +(resultInMonad, ts, subPatTypes, subPats)) // [1] there are `firstIndexingBinder` non-seq tuple elements preceding the Seq // [2] then we have to index the binder that represents the sequence for the remaining subpatterns, except for... diff --git a/src/dotty/tools/dotc/transform/SuperAccessors.scala b/src/dotty/tools/dotc/transform/SuperAccessors.scala index b55628868..36f0acc83 100644 --- a/src/dotty/tools/dotc/transform/SuperAccessors.scala +++ b/src/dotty/tools/dotc/transform/SuperAccessors.scala @@ -72,7 +72,7 @@ class SuperAccessors extends MacroTransform with IdentityDenotTransformer { this private val accDefs = mutable.Map[Symbol, ListBuffer[Tree]]() private def storeAccessorDefinition(clazz: Symbol, tree: Tree) = { - val buf = accDefs.getOrElse(clazz, sys.error("no acc def buf for "+clazz)) + val buf = accDefs.getOrElse(clazz, sys.error("no acc def buf for " + clazz)) buf += tree } -- cgit v1.2.3