diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 21727c7ec2be..83d60b398d8a 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -2459,7 +2459,7 @@ object Parsers { else Nil /** Enumerator ::= Generator - * | Guard + * | Guard {Guard} * | Pattern1 `=' Expr */ def enumerator(): Tree = diff --git a/docs/docs/internals/syntax.md b/docs/docs/internals/syntax.md index 670d46ff0568..74b5fc274241 100644 --- a/docs/docs/internals/syntax.md +++ b/docs/docs/internals/syntax.md @@ -269,9 +269,9 @@ ForExpr ::= ‘for’ (‘(’ Enumerators ‘)’ | ‘{’ Enumerat | ‘for’ Enumerators (‘do’ Expr | ‘yield’ Expr) ForDo(enums, expr) Enumerators ::= Generator {semi Enumerator | Guard} Enumerator ::= Generator - | Guard + | Guard {Guard} | Pattern1 ‘=’ Expr GenAlias(pat, expr) -Generator ::= [‘case’] Pattern1 ‘<-’ Expr GenFrom(pat, expr) +Generator ::= [‘case’] Pattern1 ‘<-’ Expr GenFrom(pat, expr) Guard ::= ‘if’ PostfixExpr CaseClauses ::= CaseClause { CaseClause } Match(EmptyTree, cases) diff --git a/docs/docs/reference/syntax.md b/docs/docs/reference/syntax.md index b2de66272ddf..ff87b3d61d57 100644 --- a/docs/docs/reference/syntax.md +++ b/docs/docs/reference/syntax.md @@ -264,7 +264,7 @@ ForExpr ::= ‘for’ (‘(’ Enumerators ‘)’ | ‘{’ Enumerat | ‘for’ Enumerators (‘do’ Expr | ‘yield’ Expr) Enumerators ::= Generator {semi Enumerator | Guard} Enumerator ::= Generator - | Guard + | Guard {Guard} | Pattern1 ‘=’ Expr Generator ::= [‘case’] Pattern1 ‘<-’ Expr Guard ::= ‘if’ PostfixExpr