@@ -1237,7 +1237,7 @@ object Parsers {
12371237
12381238 def colonAtEOLOpt (): Unit = {
12391239 possibleColonOffset = in.lastOffset
1240- if ( in.token == COLONEOL ) in.nextToken()
1240+ if in.token == COLONEOL then in.nextToken()
12411241 }
12421242
12431243 def argumentStart (): Unit =
@@ -3736,8 +3736,8 @@ object Parsers {
37363736 (EmptyValDef , Nil )
37373737 Template (constr, parents, derived, self, stats)
37383738
3739- def templateBody (): (ValDef , List [Tree ]) =
3740- val r = inDefScopeBraces(templateStatSeq(), rewriteWithColon = true )
3739+ def templateBody (rewriteWithColon : Boolean = true ): (ValDef , List [Tree ]) =
3740+ val r = inDefScopeBraces(templateStatSeq(), rewriteWithColon)
37413741 if in.token == WITH then
37423742 syntaxError(EarlyDefinitionsNotSupported ())
37433743 in.nextToken()
@@ -3747,7 +3747,7 @@ object Parsers {
37473747 /** with Template, with EOL <indent> interpreted */
37483748 def withTemplate (constr : DefDef , parents : List [Tree ]): Template =
37493749 accept(WITH )
3750- val (self, stats) = templateBody()
3750+ val (self, stats) = templateBody(rewriteWithColon = false )
37513751 Template (constr, parents, Nil , self, stats)
37523752 .withSpan(Span (constr.span.orElse(parents.head.span).start, in.lastOffset))
37533753
@@ -4000,7 +4000,7 @@ object Parsers {
40004000 EmptyTree
40014001 }
40024002
4003- override def templateBody (): (ValDef , List [Thicket ]) = {
4003+ override def templateBody (rewriteWithColon : Boolean ): (ValDef , List [Thicket ]) = {
40044004 skipBraces()
40054005 (EmptyValDef , List (EmptyTree ))
40064006 }
0 commit comments