@@ -203,8 +203,8 @@ object Parsers {
203
203
} && ! in.isSoftModifierInModifierPosition
204
204
205
205
def isExprIntro : Boolean =
206
- if (in.token == IMPLIED || in.token == GIVEN ) in.lookaheadIn( BitSet ( MATCH ))
207
- else ( canStartExpressionTokens.contains(in.token) && ! in.isSoftModifierInModifierPosition)
206
+ if (in.token == GIVEN ) false
207
+ else canStartExpressionTokens.contains(in.token) && ! in.isSoftModifierInModifierPosition
208
208
209
209
def isDefIntro (allowedMods : BitSet , excludedSoftModifiers : Set [TermName ] = Set .empty): Boolean =
210
210
in.token == AT ||
@@ -1646,15 +1646,6 @@ object Parsers {
1646
1646
if (in.token == MATCH ) impliedMatch(start, imods)
1647
1647
else implicitClosure(start, location, imods)
1648
1648
}
1649
- else if (in.token == IMPLIED || in.token == GIVEN ) {
1650
- in.nextToken()
1651
- if (in.token == MATCH )
1652
- impliedMatch(start, EmptyModifiers )
1653
- else {
1654
- syntaxError(" `match` expected" )
1655
- EmptyTree
1656
- }
1657
- }
1658
1649
else {
1659
1650
val saved = placeholderParams
1660
1651
placeholderParams = Nil
@@ -3316,10 +3307,17 @@ object Parsers {
3316
3307
Template (constr, parents, Nil , EmptyValDef , Nil )
3317
3308
}
3318
3309
3319
- /** GivenDef ::= [id] [DefTypeParamClause] GivenBody
3320
- * GivenBody ::= [‘as ConstrApp {‘,’ ConstrApp }] {GivenParamClause} [TemplateBody]
3321
- * | ‘as’ Type {GivenParamClause} ‘=’ Expr
3322
- * | ‘(’ DefParam ‘)’ TemplateBody
3310
+ /** OLD:
3311
+ * GivenDef ::= [id] [DefTypeParamClause] GivenBody
3312
+ * GivenBody ::= [‘as ConstrApp {‘,’ ConstrApp }] {GivenParamClause} [TemplateBody]
3313
+ * | ‘as’ Type {GivenParamClause} ‘=’ Expr
3314
+ * | ‘(’ DefParam ‘)’ TemplateBody
3315
+ * NEW:
3316
+ * GivenDef ::= [GivenSig (‘:’ | <:)] Type ‘=’ Expr
3317
+ * | [GivenSig ‘:’] [ConstrApp {‘,’ ConstrApp }] [TemplateBody]
3318
+ * // | [id ‘:’] [ExtParamClause] TemplateBody (not yet implemented)
3319
+ * ExtParamClause ::= [DefTypeParamClause] DefParamClause {GivenParamClause}
3320
+ * GivenSig ::= [id] [DefTypeParamClause] {GivenParamClause}
3323
3321
*/
3324
3322
def instanceDef (newStyle : Boolean , start : Offset , mods : Modifiers , instanceMod : Mod ) = atSpan(start, nameStart) {
3325
3323
var mods1 = addMod(mods, instanceMod)
0 commit comments