Skip to content

Commit

Permalink
Merge pull request #11215 from unkarjedy/patch-3
Browse files Browse the repository at this point in the history
syntax.md: support multiple if-guards on same line
  • Loading branch information
odersky committed Oct 13, 2021
2 parents a62acc8 + 294351a commit d3a26e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2478,7 +2478,7 @@ object Parsers {
else Nil

/** Enumerator ::= Generator
* | Guard
* | Guard {Guard}
* | Pattern1 `=' Expr
*/
def enumerator(): Tree =
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/internals/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ ForExpr ::= ‘for’ ‘(’ Enumerators0 ‘)’ {nl} [‘do‘ |
Enumerators0 ::= {nl} Enumerators [semi]
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)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ ForExpr ::= ‘for’ ‘(’ Enumerators0 ‘)’ {nl} [‘do‘ |
Enumerators0 ::= {nl} Enumerators [semi]
Enumerators ::= Generator {semi Enumerator | Guard}
Enumerator ::= Generator
| Guard
| Guard {Guard}
| Pattern1 ‘=’ Expr
Generator ::= [‘case’] Pattern1 ‘<-’ Expr
Guard ::= ‘if’ PostfixExpr
Expand Down

0 comments on commit d3a26e2

Please sign in to comment.