@@ -2074,7 +2074,7 @@ object Parsers {
20742074 if isIdent(nme.raw.STAR ) then
20752075 in.nextToken()
20762076 if ! (location.inArgs && in.token == RPAREN ) then
2077- if opStack.nonEmpty
2077+ if opStack.nonEmpty then
20782078 report.errorOrMigrationWarning(
20792079 em """ `_*` can be used only for last argument of method application.
20802080 |It is no longer allowed in operands of infix operations. """ ,
@@ -2151,7 +2151,7 @@ object Parsers {
21512151 val name = bindingName()
21522152 val t =
21532153 if (in.token == COLON && location == Location .InBlock ) {
2154- if sourceVersion.isAtLeast(`3.1`)
2154+ if sourceVersion.isAtLeast(`3.1`) then
21552155 // Don't error in non-strict mode, as the alternative syntax "implicit (x: T) => ... "
21562156 // is not supported by Scala2.x
21572157 report.errorOrMigrationWarning(
@@ -3331,21 +3331,19 @@ object Parsers {
33313331 }
33323332 if (migrateTo3) newLineOptWhenFollowedBy(LBRACE )
33333333 val rhs =
3334- if ( in.token == EQUALS )
3334+ if in.token == EQUALS then
33353335 in.nextToken()
33363336 subExpr()
3337- else if ( ! tpt.isEmpty)
3337+ else if ! tpt.isEmpty then
33383338 EmptyTree
3339- else if ( scala2ProcedureSyntax(" : Unit" )) {
3339+ else if scala2ProcedureSyntax(" : Unit" ) then
33403340 tpt = scalaUnit
33413341 if (in.token == LBRACE ) expr()
33423342 else EmptyTree
3343- }
3344- else {
3343+ else
33453344 if (! isExprIntro) syntaxError(MissingReturnType (), in.lastOffset)
33463345 accept(EQUALS )
33473346 expr()
3348- }
33493347
33503348 val ddef = DefDef (name, tparams, vparamss, tpt, rhs)
33513349 if (isBackquoted(ident)) ddef.pushAttachment(Backquoted , ())
@@ -3357,7 +3355,7 @@ object Parsers {
33573355 * | `{' SelfInvocation {semi BlockStat} `}'
33583356 */
33593357 val constrExpr : () => Tree = () =>
3360- if ( in.isNestedStart)
3358+ if in.isNestedStart then
33613359 atSpan(in.offset) {
33623360 inBracesOrIndented {
33633361 val stats = selfInvocation() :: (
@@ -3779,9 +3777,9 @@ object Parsers {
37793777 stats ++= importClause(EXPORT , Export .apply)
37803778 else if isIdent(nme.extension) && followingIsExtension() then
37813779 stats += extension()
3782- else if isDefIntro(modifierTokens)
3780+ else if isDefIntro(modifierTokens) then
37833781 stats +++= defOrDcl(in.offset, defAnnotsMods(modifierTokens))
3784- else if ( ! isStatSep)
3782+ else if ! isStatSep then
37853783 if (in.token == CASE )
37863784 syntaxErrorOrIncomplete(OnlyCaseClassOrCaseObjectAllowed ())
37873785 else
0 commit comments