@@ -319,7 +319,7 @@ ClsTypeParamClause::= ‘[’ ClsTypeParam {‘,’ ClsTypeParam} ‘]’
319
319
ClsTypeParam ::= {Annotation} [‘+’ | ‘-’] TypeDef(Modifiers, name, tparams, bounds)
320
320
id [HkTypeParamClause] TypeParamBounds Bound(below, above, context)
321
321
322
- DefTypeParamClause::= ‘[’ DefTypeParam {‘,’ DefTypeParam} ‘]’
322
+ DefTypeParamClause::= [nl] ‘[’ DefTypeParam {‘,’ DefTypeParam} ‘]’
323
323
DefTypeParam ::= {Annotation} id [HkTypeParamClause] TypeParamBounds
324
324
325
325
TypTypeParamClause::= ‘[’ TypTypeParam {‘,’ TypTypeParam} ‘]’
@@ -337,11 +337,18 @@ ClsParam ::= {Annotation}
337
337
[{Modifier} (‘val’ | ‘var’) | ‘inline’] Param
338
338
Param ::= id ‘:’ ParamType [‘=’ Expr]
339
339
340
- DefParamClauses ::= {DefParamClause} [[nl] ‘(’ [‘implicit’] DefParams ‘)’]
341
- DefParamClause ::= [nl] ‘(’ DefParams ‘)’ | UsingParamClause
342
- UsingParamClause ::= [nl] ‘(’ ‘using’ (DefParams | FunArgTypes) ‘)’
343
- DefParams ::= DefParam {‘,’ DefParam}
344
- DefParam ::= {Annotation} [‘inline’] Param ValDef(mods, id, tpe, expr) -- point of mods at id.
340
+ DefParamClauses ::= DefParamClause { DefParamClause }
341
+ DefParamClause ::= DefTypeParamClause
342
+ | DefTermParamClause
343
+ | UsingParamClause
344
+ DefTermParamClause::= [nl] ‘(’ [DefTermParams] ‘)’
345
+ UsingParamClause ::= [nl] ‘(’ ‘using’ (DefTermParams | FunArgTypes) ‘)’
346
+ DefTermParams ::= DefTermParam {‘,’ DefTermParam}
347
+ DefTermParam ::= {Annotation} [‘inline’] Param ValDef(mods, id, tpe, expr) -- point of mods at id.
348
+ TypelessClauses ::= TypelessClause {TypelessClause}
349
+ TypelessClause ::= DefTermParamClause
350
+ | UsingParamClause
351
+ DefImplicitClause ::= [nl] ‘(’ ‘implicit’ DefTermParams ‘)’
345
352
```
346
353
347
354
### Bindings and Imports
@@ -392,7 +399,7 @@ Dcl ::= RefineDcl
392
399
ValDcl ::= ids ‘:’ Type PatDef(_, ids, tpe, EmptyTree)
393
400
VarDcl ::= ids ‘:’ Type PatDef(_, ids, tpe, EmptyTree)
394
401
DefDcl ::= DefSig ‘:’ Type DefDef(_, name, tparams, vparamss, tpe, EmptyTree)
395
- DefSig ::= id [DefTypeParamClause] DefParamClauses
402
+ DefSig ::= id [DefParamClauses] [DefImplicitClause]
396
403
TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds TypeDefTree(_, name, tparams, bound
397
404
[‘=’ Type]
398
405
@@ -403,8 +410,8 @@ Def ::= ‘val’ PatDef
403
410
| TmplDef
404
411
PatDef ::= ids [‘:’ Type] ‘=’ Expr
405
412
| Pattern2 [‘:’ Type] ‘=’ Expr PatDef(_, pats, tpe?, expr)
406
- DefDef ::= DefSig [‘:’ Type] ‘=’ Expr DefDef(_, name, tparams, vparamss , tpe, expr)
407
- | ‘this’ DefParamClause DefParamClauses ‘=’ ConstrExpr DefDef(_, <init>, Nil , vparamss, EmptyTree, expr | Block)
413
+ DefDef ::= DefSig [‘:’ Type] ‘=’ Expr DefDef(_, name, paramss , tpe, expr)
414
+ | ‘this’ TypelessClauses [DefImplicitClause] ‘=’ ConstrExpr DefDef(_, <init>, vparamss, EmptyTree, expr | Block)
408
415
409
416
TmplDef ::= ([‘case’] ‘class’ | ‘trait’) ClassDef
410
417
| [‘case’] ‘object’ ObjectDef
@@ -416,10 +423,10 @@ ConstrMods ::= {Annotation} [AccessModifier]
416
423
ObjectDef ::= id [Template] ModuleDef(mods, name, template) // no constructor
417
424
EnumDef ::= id ClassConstr InheritClauses EnumBody
418
425
GivenDef ::= [GivenSig] (AnnotType [‘=’ Expr] | StructuralInstance)
419
- GivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefParamClause `, `UsingParamClause` must be present
426
+ GivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefTypeParamClause `, `UsingParamClause` must be present
420
427
StructuralInstance ::= ConstrApp {‘with’ ConstrApp} [‘with’ TemplateBody]
421
428
Extension ::= ‘extension’ [DefTypeParamClause] {UsingParamClause}
422
- ‘(’ DefParam ‘)’ {UsingParamClause} ExtMethods
429
+ ‘(’ DefTermParam ‘)’ {UsingParamClause} ExtMethods
423
430
ExtMethods ::= ExtMethod | [nl] <<< ExtMethod {semi ExtMethod} >>>
424
431
ExtMethod ::= {Annotation [nl]} {Modifier} ‘def’ DefDef
425
432
Template ::= InheritClauses [TemplateBody]
0 commit comments