@@ -581,11 +581,6 @@ object Parsers {
581
581
*/
582
582
var possibleColonOffset : Int = - 1
583
583
584
- /** A list of pending patches, to be issued if we can rewrite all enclosing braces to
585
- * indentation regions.
586
- */
587
- var pendingPatches : List [() => Unit ] = Nil
588
-
589
584
def testChar (idx : Int , p : Char => Boolean ): Boolean = {
590
585
val txt = source.content
591
586
idx < txt.length && p(txt(idx))
@@ -703,7 +698,6 @@ object Parsers {
703
698
val colonRequired = possibleColonOffset == in.lastOffset
704
699
val (startOpening, endOpening) = startingElimRegion(colonRequired)
705
700
val isOutermost = in.currentRegion.isOutermost
706
- val savedPending = pendingPatches
707
701
def allBraces (r : Region ): Boolean = r match {
708
702
case r : InBraces => allBraces(r.enclosing)
709
703
case _ => r.isOutermost
@@ -725,17 +719,9 @@ object Parsers {
725
719
else if (testChar(startOpening - 1 , Chars .isOperatorPart(_))) " :"
726
720
else " :"
727
721
val (startClosing, endClosing) = closingElimRegion()
728
- val applyPatch = () => {
729
- patch(source, Span (startOpening, endOpening), openingPatchStr)
730
- patch(source, Span (startClosing, endClosing), " " )
731
- }
732
- pendingPatches = applyPatch :: pendingPatches
733
- if (isOutermost) {
734
- pendingPatches.reverse.foreach(_())
735
- pendingPatches = Nil
736
- }
722
+ patch(source, Span (startOpening, endOpening), openingPatchStr)
723
+ patch(source, Span (startClosing, endClosing), " " )
737
724
}
738
- else pendingPatches = savedPending // can't rewrite, cancel all nested patches.
739
725
t
740
726
}
741
727
@@ -3367,9 +3353,8 @@ object Parsers {
3367
3353
case _ => false
3368
3354
}
3369
3355
3370
- def givenArgs (t : Tree ): Tree = {
3356
+ def givenArgs (t : Tree ): Tree =
3371
3357
if (in.token == GIVEN ) givenArgs(applyGiven(t, prefixExpr)) else t
3372
- }
3373
3358
3374
3359
if (in.token == LPAREN )
3375
3360
inParens {
0 commit comments