diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-12 14:23:07 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-12 14:23:07 -0700 |
commit | be3b73e4837d1dd3fc9db945118f38b6338c4f0b (patch) | |
tree | 3ae71de4ca23193e93601f8311ff40adfd1e7dfb | |
parent | 507e58bef8dd7d0a77247e85d3180313d44bc45e (diff) | |
parent | d6142284818305bf756d588fd601dca4c8adaaf0 (diff) | |
download | scala-be3b73e4837d1dd3fc9db945118f38b6338c4f0b.tar.gz scala-be3b73e4837d1dd3fc9db945118f38b6338c4f0b.tar.bz2 scala-be3b73e4837d1dd3fc9db945118f38b6338c4f0b.zip |
Merge pull request #1 from som-snytt/issue/7937
SI-7937 In for, semi before guard never required
-rw-r--r-- | 08-expressions.md | 7 | ||||
-rw-r--r-- | 15-scala-syntax-summary.md | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/08-expressions.md b/08-expressions.md index 8331bcaa1c..ba237d4952 100644 --- a/08-expressions.md +++ b/08-expressions.md @@ -931,11 +931,8 @@ A semicolon preceding the `while` symbol of a do loop expression is ignored. ``` Expr1 ::= `for' (`(' Enumerators `)' | `{' Enumerators `}') {nl} [`yield'] Expr -Enumerators ::= Generator {semi Enumerator} -Enumerator ::= Generator - | Guard - | Pattern1 `=' Expr -Generator ::= Pattern1 `<-' Expr [Guard] +Enumerators ::= Generator {semi Generator} +Generator ::= Pattern1 `<-' Expr {[semi] Guard | semi Pattern1 `=' Expr} Guard ::= `if' PostfixExpr ``` diff --git a/15-scala-syntax-summary.md b/15-scala-syntax-summary.md index 0a5a8f73a0..fcf93b7ab0 100644 --- a/15-scala-syntax-summary.md +++ b/15-scala-syntax-summary.md @@ -152,11 +152,8 @@ grammar. ResultExpr ::= Expr1 | (Bindings | ([‘implicit’] id | ‘_’) ‘:’ CompoundType) ‘=>’ Block - Enumerators ::= Generator {semi Enumerator} - Enumerator ::= Generator - | Guard - | Pattern1 ‘=’ Expr - Generator ::= Pattern1 ‘<-’ Expr [Guard] + Enumerators ::= Generator {semi Generator} + Generator ::= Pattern1 ‘<-’ Expr {[semi] Guard | semi Pattern1 ‘=’ Expr} CaseClauses ::= CaseClause { CaseClause } CaseClause ::= ‘case’ Pattern [Guard] ‘=>’ Block |