@@ -214,7 +214,7 @@ SimpleExpr ::= Path
214
214
| ‘$’ ‘{’ Block ‘}’
215
215
| Quoted
216
216
| quoteId // only inside splices
217
- | ‘new’ ConstrApp {` with` ConstrApp} [TemplateBody] New(constr | templ)
217
+ | ‘new’ ConstrApp {‘ with’ ConstrApp} [[‘with’] TemplateBody] New(constr | templ)
218
218
| ‘new’ TemplateBody
219
219
| ‘(’ ExprsInParens ‘)’ Parens(exprs)
220
220
| SimpleExpr ‘.’ id Select(expr, id)
@@ -383,24 +383,23 @@ ClassDef ::= id ClassConstr [Template]
383
383
ClassConstr ::= [ClsTypeParamClause] [ConstrMods] ClsParamClauses with DefDef(_, <init>, Nil, vparamss, EmptyTree, EmptyTree) as first stat
384
384
ConstrMods ::= {Annotation} [AccessModifier]
385
385
ObjectDef ::= id [Template] ModuleDef(mods, name, template) // no constructor
386
- EnumDef ::= id ClassConstr InheritClauses EnumBody EnumDef(mods, name, tparams, template)
386
+ EnumDef ::= id ClassConstr InheritClauses [‘with’] EnumBody EnumDef(mods, name, tparams, template)
387
387
GivenDef ::= [GivenSig (‘:’ | <:)] Type ‘=’ Expr
388
- | [GivenSig ‘:’] [ConstrApp {‘,’ ConstrApp }] [TemplateBody]
388
+ | [GivenSig ‘:’] [ConstrApp {‘,’ ConstrApp }] [[‘with’] TemplateBody]
389
389
| [[id ‘:’] ‘extension’ ExtParamClause {GivenParamClause}
390
390
ExtMethods
391
391
GivenSig ::= [id] [DefTypeParamClause] {GivenParamClause}
392
392
ExtParamClause ::= [DefTypeParamClause] ‘(’ DefParam ‘)’
393
393
ExtMethods ::= [nl] ‘{’ ‘def’ DefDef {semi ‘def’ DefDef} ‘}’
394
- Template ::= InheritClauses [TemplateBody] Template(constr, parents, self, stats)
394
+ Template ::= InheritClauses [[‘with’] TemplateBody] Template(constr, parents, self, stats)
395
395
InheritClauses ::= [‘extends’ ConstrApps] [‘derives’ QualId {‘,’ QualId}]
396
396
ConstrApps ::= ConstrApp {(‘,’ | ‘with’) ConstrApp}
397
397
ConstrApp ::= AnnotType {ParArgumentExprs} Apply(tp, args)
398
398
ConstrExpr ::= SelfInvocation
399
399
| ‘{’ SelfInvocation {semi BlockStat} ‘}’
400
400
SelfInvocation ::= ‘this’ ArgumentExprs {ArgumentExprs}
401
401
402
- TemplateBody ::= [nl | ‘with’]
403
- ‘{’ [SelfType] TemplateStat {semi TemplateStat} ‘}’ (self, stats)
402
+ TemplateBody ::= [nl] ‘{’ [SelfType] TemplateStat {semi TemplateStat} ‘}’ (self, stats)
404
403
TemplateStat ::= Import
405
404
| Export
406
405
| {Annotation [nl]} {Modifier} Def
0 commit comments