@@ -619,7 +619,7 @@ object Parsers {
619
619
if in.isNewLine && ! (nextIndentWidth < startIndentWidth) then
620
620
warning(
621
621
if startIndentWidth <= nextIndentWidth then
622
- i """ Line is indented too far to the right, or a `{' is missing before:
622
+ i """ Line is indented too far to the right, or a `{` is missing before:
623
623
|
624
624
| $t"""
625
625
else
@@ -638,7 +638,7 @@ object Parsers {
638
638
case r : IndentSignificantRegion if in.isNewLine =>
639
639
val nextIndentWidth = in.indentWidth(in.next.offset)
640
640
if r.indentWidth < nextIndentWidth then
641
- warning(i " Line is indented too far to the right, or a `{' is missing " , in.next.offset)
641
+ warning(i " Line is indented too far to the right, or a `{` is missing " , in.next.offset)
642
642
case _ =>
643
643
644
644
/* -------- REWRITES ----------------------------------------------------------- */
@@ -1277,7 +1277,7 @@ object Parsers {
1277
1277
if in.token == WITH then
1278
1278
in.nextToken()
1279
1279
if in.token != LBRACE && in.token != INDENT then
1280
- syntaxError(i " indented definitions or `{' expected " )
1280
+ syntaxError(i " indented definitions or `{` expected " )
1281
1281
else
1282
1282
if silentTemplateIndent && ! isNew then in.observeIndented()
1283
1283
newLineOptWhenFollowedBy(LBRACE )
@@ -1797,8 +1797,8 @@ object Parsers {
1797
1797
}
1798
1798
case DO =>
1799
1799
in.errorOrMigrationWarning(
1800
- i """ `do <body> while <cond>' is no longer supported,
1801
- |use `while ({<body> ; <cond>}) ()' instead.
1800
+ i """ `do <body> while <cond>` is no longer supported,
1801
+ |use `while ({<body> ; <cond>}) ()` instead.
1802
1802
| ${rewriteNotice(" -language:Scala2Compat" )}
1803
1803
""" )
1804
1804
val start = in.skipToken()
@@ -2484,15 +2484,15 @@ object Parsers {
2484
2484
infixPattern() match {
2485
2485
case pt @ Ident (tpnme.WILDCARD_STAR ) =>
2486
2486
if (ctx.settings.strict.value)
2487
- in.errorOrMigrationWarning(" The syntax `x @ _*' is no longer supported; use `x : _*' instead" , Span (startOffset(p)))
2487
+ in.errorOrMigrationWarning(" The syntax `x @ _*` is no longer supported; use `x : _*` instead" , Span (startOffset(p)))
2488
2488
atSpan(startOffset(p), offset) { Typed (p, pt) }
2489
2489
case pt =>
2490
2490
atSpan(startOffset(p), 0 ) { Bind (name, pt) }
2491
2491
}
2492
2492
case p @ Ident (tpnme.WILDCARD_STAR ) =>
2493
2493
// compatibility for Scala2 `_*` syntax
2494
2494
if (ctx.settings.strict.value)
2495
- in.errorOrMigrationWarning(" The syntax `_*' is no longer supported; use `x : _*' instead" , Span (startOffset(p)))
2495
+ in.errorOrMigrationWarning(" The syntax `_*` is no longer supported; use `x : _*` instead" , Span (startOffset(p)))
2496
2496
atSpan(startOffset(p)) { Typed (Ident (nme.WILDCARD ), p) }
2497
2497
case p =>
2498
2498
p
@@ -2815,7 +2815,7 @@ object Parsers {
2815
2815
addMod(mods, mod)
2816
2816
else
2817
2817
if (! (mods.flags &~ (ParamAccessor | Inline | impliedMods.flags)).isEmpty)
2818
- syntaxError(" `val' or `var' expected" )
2818
+ syntaxError(" `val` or `var` expected" )
2819
2819
if (firstClause && ofCaseClass) mods
2820
2820
else mods | PrivateLocal
2821
2821
}
@@ -3100,7 +3100,7 @@ object Parsers {
3100
3100
val toInsert =
3101
3101
if (in.token == LBRACE ) s " $resultTypeStr = "
3102
3102
else " : Unit " // trailing space ensures that `def f()def g()` works.
3103
- in.testScala2CompatMode(s " Procedure syntax no longer supported; ` $toInsert' should be inserted here" ) && {
3103
+ in.testScala2CompatMode(s " Procedure syntax no longer supported; ` $toInsert` should be inserted here" ) && {
3104
3104
patch(source, Span (in.lastOffset), toInsert)
3105
3105
true
3106
3106
}
@@ -3441,7 +3441,7 @@ object Parsers {
3441
3441
constrApps(commaOK = true , templateCanFollow = true )
3442
3442
else if in.token == SUBTYPE then
3443
3443
if ! mods.is(Inline ) then
3444
- syntaxError(" `<:' is only allowed for given with `inline' modifier" )
3444
+ syntaxError(" `<:` is only allowed for given with `inline` modifier" )
3445
3445
in.nextToken()
3446
3446
TypeBoundsTree (EmptyTree , toplevelTyp()) :: Nil
3447
3447
else
@@ -3454,7 +3454,7 @@ object Parsers {
3454
3454
DefDef (name, tparams, vparamss, parents.head, subExpr())
3455
3455
else
3456
3456
parents match
3457
- case TypeBoundsTree (_, _) :: _ => syntaxError(" `=' expected" )
3457
+ case TypeBoundsTree (_, _) :: _ => syntaxError(" `=` expected" )
3458
3458
case _ =>
3459
3459
possibleTemplateStart()
3460
3460
val tparams1 = tparams.map(tparam => tparam.withMods(tparam.mods | PrivateLocal ))
@@ -3504,7 +3504,7 @@ object Parsers {
3504
3504
if (in.token == EXTENDS ) {
3505
3505
in.nextToken()
3506
3506
if (in.token == LBRACE || in.token == COLONEOL ) {
3507
- in.errorOrMigrationWarning(" `extends' must be followed by at least one parent" )
3507
+ in.errorOrMigrationWarning(" `extends` must be followed by at least one parent" )
3508
3508
Nil
3509
3509
}
3510
3510
else constrApps(commaOK = true , templateCanFollow = true )
@@ -3692,7 +3692,7 @@ object Parsers {
3692
3692
else if (! isStatSep)
3693
3693
syntaxErrorOrIncomplete(
3694
3694
" illegal start of declaration" +
3695
- (if (inFunReturnType) " (possible cause: missing `=' in front of current method body)"
3695
+ (if (inFunReturnType) " (possible cause: missing `=` in front of current method body)"
3696
3696
else " " ))
3697
3697
acceptStatSepUnlessAtEnd()
3698
3698
}
0 commit comments