@@ -203,8 +203,8 @@ object Parsers {
203203 } && ! in.isSoftModifierInModifierPosition
204204
205205 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
208208
209209 def isDefIntro (allowedMods : BitSet , excludedSoftModifiers : Set [TermName ] = Set .empty): Boolean =
210210 in.token == AT ||
@@ -1646,15 +1646,6 @@ object Parsers {
16461646 if (in.token == MATCH ) impliedMatch(start, imods)
16471647 else implicitClosure(start, location, imods)
16481648 }
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- }
16581649 else {
16591650 val saved = placeholderParams
16601651 placeholderParams = Nil
@@ -3316,10 +3307,17 @@ object Parsers {
33163307 Template (constr, parents, Nil , EmptyValDef , Nil )
33173308 }
33183309
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}
33233321 */
33243322 def instanceDef (newStyle : Boolean , start : Offset , mods : Modifiers , instanceMod : Mod ) = atSpan(start, nameStart) {
33253323 var mods1 = addMod(mods, instanceMod)
0 commit comments