@@ -26,7 +26,7 @@ upper ::= ‘A’ | … | ‘Z’ | ‘\$’ | ‘_’ “… and U
26
26
lower ::= ‘a’ | … | ‘z’ “… and Unicode category Ll”
27
27
letter ::= upper | lower “… and Unicode categories Lo, Lt, Nl”
28
28
digit ::= ‘0’ | … | ‘9’
29
- paren ::= ‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’
29
+ paren ::= ‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’ | ‘'(’ | ‘'[’ | ‘'{’
30
30
delim ::= ‘`’ | ‘'’ | ‘"’ | ‘.’ | ‘;’ | ‘,’
31
31
opchar ::= “printableChar not matched by (whiteSpace | upper | lower |
32
32
letter | digit | paren | delim | opchar | Unicode_Sm |
@@ -183,9 +183,9 @@ InfixExpr ::= PrefixExpr
183
183
PrefixExpr ::= [‘-’ | ‘+’ | ‘~’ | ‘!’] SimpleExpr PrefixOp(expr, op)
184
184
SimpleExpr ::= ‘new’ Template New(templ)
185
185
| BlockExpr
186
- | ‘'’ BlockExpr
187
- | ‘'’ ‘ (’ ExprsInParens ‘)’
188
- | ‘'’ ‘ [’ Type ‘]’
186
+ | ''{’ BlockExprContents ‘}’
187
+ | ‘'(’ ExprsInParens ‘)’
188
+ | ‘'[’ Type ‘]’
189
189
| SimpleExpr1 [‘_’] PostfixOp(expr, _)
190
190
SimpleExpr1 ::= Literal
191
191
| Path
@@ -202,8 +202,8 @@ ParArgumentExprs ::= ‘(’ ExprsInParens ‘)’
202
202
| ‘(’ [ExprsInParens] PostfixExpr ‘:’ ‘_’ ‘*’ ‘)’ exprs :+ Typed(expr, Ident(wildcardStar))
203
203
ArgumentExprs ::= ParArgumentExprs
204
204
| [nl] BlockExpr
205
- BlockExpr ::= ‘{’ CaseClauses ‘}’ Match(EmptyTree, cases)
206
- | ‘{’ Block ‘}’ block // starts at {
205
+ BlockExpr ::= ‘{’ BlockExprContents ‘}’
206
+ BlockExprContents ::= CaseClauses | Block
207
207
Block ::= {BlockStat semi} [BlockResult] Block(stats, expr?)
208
208
BlockStat ::= Import
209
209
| {Annotation} [‘implicit’ | ‘lazy’] Def
@@ -220,8 +220,8 @@ Enumerator ::= Generator
220
220
Generator ::= Pattern1 ‘<-’ Expr GenFrom(pat, expr)
221
221
Guard ::= ‘if’ PostfixExpr
222
222
223
- CaseClauses ::= CaseClause { CaseClause } CaseDef(pat, guard?, block) // block starts at =>
224
- CaseClause ::= ‘case’ (Pattern [Guard] ‘=>’ Block | INT)
223
+ CaseClauses ::= CaseClause { CaseClause } Match(EmptyTree, cases)
224
+ CaseClause ::= ‘case’ (Pattern [Guard] ‘=>’ Block | INT) CaseDef(pat, guard?, block) // block starts at =>
225
225
226
226
Pattern ::= Pattern1 { ‘|’ Pattern1 } Alternative(pats)
227
227
Pattern1 ::= PatVar ‘:’ RefinedType Bind(name, Typed(Ident(wildcard), tpe))
0 commit comments