@@ -209,22 +209,22 @@ Ascription ::= ‘:’ InfixType
209
209
Catches ::= ‘catch’ Expr
210
210
PostfixExpr ::= InfixExpr [id] PostfixOp(expr, op)
211
211
InfixExpr ::= PrefixExpr
212
- | InfixExpr id [cnl ] InfixExpr InfixOp(expr, op, expr)
212
+ | InfixExpr id [nl ] InfixExpr InfixOp(expr, op, expr)
213
213
| InfixExpr ‘given’ (InfixExpr | ParArgumentExprs)
214
214
PrefixExpr ::= [‘-’ | ‘+’ | ‘~’ | ‘!’] SimpleExpr PrefixOp(expr, op)
215
- SimpleExpr ::= ‘new’ (ConstrApp [TemplateBody] | TemplateBody) New(constr | templ)
215
+ SimpleExpr ::= Path
216
+ | Literal
217
+ | ‘_’
216
218
| BlockExpr
217
219
| ‘$’ ‘{’ Block ‘}’
218
220
| Quoted
219
221
| quoteId // only inside splices
220
- | SimpleExpr1 [‘_’] PostfixOp(expr, _)
221
- SimpleExpr1 ::= Literal
222
- | Path
223
- | ‘_’
222
+ | ‘new’ (ConstrApp [TemplateBody] | TemplateBody) New(constr | templ)
224
223
| ‘(’ ExprsInParens ‘)’ Parens(exprs)
225
224
| SimpleExpr ‘.’ id Select(expr, id)
226
- | SimpleExpr (TypeArgs | NamedTypeArgs) TypeApply(expr, args)
227
- | SimpleExpr1 ArgumentExprs Apply(expr, args)
225
+ | SimpleExpr TypeArgs TypeApply(expr, args)
226
+ | SimpleExpr ArgumentExprs Apply(expr, args)
227
+ | SimpleExpr ‘_’ PostfixOp(expr, _)
228
228
| XmlExpr
229
229
Quoted ::= ‘'’ ‘{’ Block ‘}’
230
230
| ‘'’ ‘[’ Type ‘]’
@@ -234,8 +234,8 @@ ExprInParens ::= PostfixExpr ‘:’ Type
234
234
ParArgumentExprs ::= ‘(’ [‘given’] ExprsInParens ‘)’ exprs
235
235
| ‘(’ [ExprsInParens ‘,’] PostfixExpr ‘:’ ‘_’ ‘*’ ‘)’ exprs :+ Typed(expr, Ident(wildcardStar))
236
236
ArgumentExprs ::= ParArgumentExprs
237
- | [cnl ] BlockExpr
238
- BlockExpr ::= ‘{’ CaseClauses | Block ‘}’
237
+ | [nl ] BlockExpr
238
+ BlockExpr ::= ‘{’ ( CaseClauses | Block) ‘}’
239
239
Block ::= {BlockStat semi} [BlockResult] Block(stats, expr?)
240
240
BlockStat ::= Import
241
241
| {Annotation [nl]} [‘implicit’ | ‘lazy’] Def
@@ -263,7 +263,7 @@ Pattern ::= Pattern1 { ‘|’ Pattern1 }
263
263
Pattern1 ::= Pattern2 [‘:’ RefinedType] Bind(name, Typed(Ident(wildcard), tpe))
264
264
| ‘given’ PatVar ‘:’ RefinedType
265
265
Pattern2 ::= [id ‘@’] InfixPattern Bind(name, pat)
266
- InfixPattern ::= SimplePattern { id [cnl ] SimplePattern } InfixOp(pat, op, pat)
266
+ InfixPattern ::= SimplePattern { id [nl ] SimplePattern } InfixOp(pat, op, pat)
267
267
SimplePattern ::= PatVar Ident(wildcard)
268
268
| Literal Bind(name, Ident(wildcard))
269
269
| ‘(’ [Patterns] ‘)’ Parens(pats) Tuple(pats)
@@ -400,7 +400,7 @@ ConstrExpr ::= SelfInvocation
400
400
| ‘{’ SelfInvocation {semi BlockStat} ‘}’
401
401
SelfInvocation ::= ‘this’ ArgumentExprs {ArgumentExprs}
402
402
403
- TemplateBody ::= [cnl ] ‘{’ [SelfType] TemplateStat {semi TemplateStat} ‘}’ (self, stats)
403
+ TemplateBody ::= [nl ] ‘{’ [SelfType] TemplateStat {semi TemplateStat} ‘}’ (self, stats)
404
404
TemplateStat ::= Import
405
405
| Export
406
406
| {Annotation [nl]} {Modifier} Def
@@ -410,7 +410,7 @@ TemplateStat ::= Import
410
410
SelfType ::= id [‘:’ InfixType] ‘=>’ ValDef(_, name, tpt, _)
411
411
| ‘this’ ‘:’ InfixType ‘=>’
412
412
413
- EnumBody ::= [cnl ] ‘{’ [SelfType] EnumStat {semi EnumStat} ‘}’
413
+ EnumBody ::= [nl ] ‘{’ [SelfType] EnumStat {semi EnumStat} ‘}’
414
414
EnumStat ::= TemplateStat
415
415
| {Annotation [nl]} {Modifier} EnumCase
416
416
EnumCase ::= ‘case’ (id ClassConstr [‘extends’ ConstrApps]] | ids)
@@ -422,7 +422,7 @@ TopStat ::= Import
422
422
| Packaging
423
423
| PackageObject
424
424
|
425
- Packaging ::= ‘package’ QualId [cnl ] ‘{’ TopStatSeq ‘}’ Package(qid, stats)
425
+ Packaging ::= ‘package’ QualId [nl ] ‘{’ TopStatSeq ‘}’ Package(qid, stats)
426
426
PackageObject ::= ‘package’ ‘object’ ObjectDef object with package in mods.
427
427
428
428
CompilationUnit ::= {‘package’ QualId (semi | cnl)} TopStatSeq Package(qid, stats)
0 commit comments