From 974a5d7bba8e6dabc06cbaf082d8cb6a1e97bc8f Mon Sep 17 00:00:00 2001 From: Quentin Bernet Date: Tue, 29 Nov 2022 13:05:09 +0100 Subject: [PATCH] Fix and simplify grammar in SIP - #47 As noted in https://github.com/scala/improvement-proposals/pull/47, the grammar did not correspond to the rest of the proposal, this PR solves that --- content/clause-interleaving.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/content/clause-interleaving.md b/content/clause-interleaving.md index 2c278b61..b35c3bdf 100644 --- a/content/clause-interleaving.md +++ b/content/clause-interleaving.md @@ -103,14 +103,13 @@ It provides the best of all worlds: ### Specification We amend the syntax of def parameter clauses as follows: - ~~~ DefDcl ::= DefSig ‘:’ Type DefDef ::= DefSig [‘:’ Type] ‘=’ Expr -DefSig ::= id [DefParamClauses] [DefImplicitClause] -DefParamClauses ::= DefParamClauseChunk {DefParamClauseChunk} -DefParamClauseChunk ::= [DefTypeParamClause] TermOrUsingParamClause {TermOrUsingParamClause} -TermOrUsingParamClause ::= DefTermParamClause +DefSig ::= id [DefParamClauses] [DefImplicitClause] -- and two DefTypeParamClause cannot be adjacent +DefParamClauses ::= DefParamClause { DefParamClause } +DefParamClause ::= DefTypeParamClause + | DefTermParamClause | UsingParamClause DefTypeParamClause ::= [nl] ‘[’ DefTypeParam {‘,’ DefTypeParam} ‘]’ DefTypeParam ::= {Annotation} id [HkTypeParamClause] TypeParamBounds