@@ -2074,7 +2074,7 @@ object Parsers {
2074
2074
if isIdent(nme.raw.STAR ) then
2075
2075
in.nextToken()
2076
2076
if ! (location.inArgs && in.token == RPAREN ) then
2077
- if opStack.nonEmpty
2077
+ if opStack.nonEmpty then
2078
2078
report.errorOrMigrationWarning(
2079
2079
em """ `_*` can be used only for last argument of method application.
2080
2080
|It is no longer allowed in operands of infix operations. """ ,
@@ -2151,7 +2151,7 @@ object Parsers {
2151
2151
val name = bindingName()
2152
2152
val t =
2153
2153
if (in.token == COLON && location == Location .InBlock ) {
2154
- if sourceVersion.isAtLeast(`3.1`)
2154
+ if sourceVersion.isAtLeast(`3.1`) then
2155
2155
// Don't error in non-strict mode, as the alternative syntax "implicit (x: T) => ... "
2156
2156
// is not supported by Scala2.x
2157
2157
report.errorOrMigrationWarning(
@@ -3331,21 +3331,19 @@ object Parsers {
3331
3331
}
3332
3332
if (migrateTo3) newLineOptWhenFollowedBy(LBRACE )
3333
3333
val rhs =
3334
- if ( in.token == EQUALS )
3334
+ if in.token == EQUALS then
3335
3335
in.nextToken()
3336
3336
subExpr()
3337
- else if ( ! tpt.isEmpty)
3337
+ else if ! tpt.isEmpty then
3338
3338
EmptyTree
3339
- else if ( scala2ProcedureSyntax(" : Unit" )) {
3339
+ else if scala2ProcedureSyntax(" : Unit" ) then
3340
3340
tpt = scalaUnit
3341
3341
if (in.token == LBRACE ) expr()
3342
3342
else EmptyTree
3343
- }
3344
- else {
3343
+ else
3345
3344
if (! isExprIntro) syntaxError(MissingReturnType (), in.lastOffset)
3346
3345
accept(EQUALS )
3347
3346
expr()
3348
- }
3349
3347
3350
3348
val ddef = DefDef (name, tparams, vparamss, tpt, rhs)
3351
3349
if (isBackquoted(ident)) ddef.pushAttachment(Backquoted , ())
@@ -3357,7 +3355,7 @@ object Parsers {
3357
3355
* | `{' SelfInvocation {semi BlockStat} `}'
3358
3356
*/
3359
3357
val constrExpr : () => Tree = () =>
3360
- if ( in.isNestedStart)
3358
+ if in.isNestedStart then
3361
3359
atSpan(in.offset) {
3362
3360
inBracesOrIndented {
3363
3361
val stats = selfInvocation() :: (
@@ -3779,9 +3777,9 @@ object Parsers {
3779
3777
stats ++= importClause(EXPORT , Export .apply)
3780
3778
else if isIdent(nme.extension) && followingIsExtension() then
3781
3779
stats += extension()
3782
- else if isDefIntro(modifierTokens)
3780
+ else if isDefIntro(modifierTokens) then
3783
3781
stats +++= defOrDcl(in.offset, defAnnotsMods(modifierTokens))
3784
- else if ( ! isStatSep)
3782
+ else if ! isStatSep then
3785
3783
if (in.token == CASE )
3786
3784
syntaxErrorOrIncomplete(OnlyCaseClassOrCaseObjectAllowed ())
3787
3785
else
0 commit comments