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