@@ -214,7 +214,7 @@ SimpleExpr ::= Path
214214 | ‘$’ ‘{’ Block ‘}’
215215 | Quoted
216216 | quoteId // only inside splices
217- | ‘new’ ConstrApp {` with` ConstrApp} [TemplateBody] New(constr | templ)
217+ | ‘new’ ConstrApp {‘ with’ ConstrApp} [[‘with’] TemplateBody] New(constr | templ)
218218 | ‘new’ TemplateBody
219219 | ‘(’ ExprsInParens ‘)’ Parens(exprs)
220220 | SimpleExpr ‘.’ id Select(expr, id)
@@ -383,24 +383,23 @@ ClassDef ::= id ClassConstr [Template]
383383ClassConstr ::= [ClsTypeParamClause] [ConstrMods] ClsParamClauses with DefDef(_, <init>, Nil, vparamss, EmptyTree, EmptyTree) as first stat
384384ConstrMods ::= {Annotation} [AccessModifier]
385385ObjectDef ::= 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)
387387GivenDef ::= [GivenSig (‘:’ | <:)] Type ‘=’ Expr
388- | [GivenSig ‘:’] [ConstrApp {‘,’ ConstrApp }] [TemplateBody]
388+ | [GivenSig ‘:’] [ConstrApp {‘,’ ConstrApp }] [[‘with’] TemplateBody]
389389 | [[id ‘:’] ‘extension’ ExtParamClause {GivenParamClause}
390390 ExtMethods
391391GivenSig ::= [id] [DefTypeParamClause] {GivenParamClause}
392392ExtParamClause ::= [DefTypeParamClause] ‘(’ DefParam ‘)’
393393ExtMethods ::= [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)
395395InheritClauses ::= [‘extends’ ConstrApps] [‘derives’ QualId {‘,’ QualId}]
396396ConstrApps ::= ConstrApp {(‘,’ | ‘with’) ConstrApp}
397397ConstrApp ::= AnnotType {ParArgumentExprs} Apply(tp, args)
398398ConstrExpr ::= SelfInvocation
399399 | ‘{’ SelfInvocation {semi BlockStat} ‘}’
400400SelfInvocation ::= ‘this’ ArgumentExprs {ArgumentExprs}
401401
402- TemplateBody ::= [nl | ‘with’]
403- ‘{’ [SelfType] TemplateStat {semi TemplateStat} ‘}’ (self, stats)
402+ TemplateBody ::= [nl] ‘{’ [SelfType] TemplateStat {semi TemplateStat} ‘}’ (self, stats)
404403TemplateStat ::= Import
405404 | Export
406405 | {Annotation [nl]} {Modifier} Def
0 commit comments