Skip to content

Commit c432c0f

Browse files
authored
Apply suggestions from code review
1 parent 466da83 commit c432c0f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3133,8 +3133,8 @@ object Parsers {
31333133
buf.toList
31343134
}
31353135

3136-
/** CaseClause ::= ‘case’ Pattern [Guard] (‘with’ SimpleExpr SubMatchClause | `=>' Block)
3137-
* ExprCaseClause ::= ‘case’ Pattern [Guard] (‘with’ SimpleExpr SubMatchClause | `=>' Expr)
3136+
/** CaseClause ::= ‘case’ Pattern [Guard] (‘if’ InfixExpr MatchClause | `=>' Block)
3137+
* ExprCaseClause ::= ‘case’ Pattern [Guard] (‘if’ InfixExpr MatchClause | `=>' Expr)
31383138
*/
31393139
def caseClause(exprOnly: Boolean = false): CaseDef = atSpan(in.offset) {
31403140
val (pat, grd) = inSepRegion(InCase) {

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
566566
}
567567
case CaseDef(pat, guard, body) =>
568568
val bodyText = body match
569-
case t: SubMatch => keywordStr(" with ") ~ toText(t)
569+
case t: SubMatch => keywordStr(" if ") ~ toText(t)
570570
case t => " => " ~ caseBlockText(t)
571571
keywordStr("case ") ~ inPattern(toText(pat)) ~ optText(guard)(keywordStr(" if ") ~ _) ~ bodyText
572572
case Labeled(bind, expr) =>

0 commit comments

Comments
 (0)