Skip to content

Commit

Permalink
Fix and simplify grammar in SIP - scala#47
Browse files Browse the repository at this point in the history
As noted in scala#47, the grammar did not correspond to the rest of the proposal, this PR solves that
  • Loading branch information
Sporarum authored and odersky committed Jul 15, 2024
1 parent a55f5e9 commit 974a5d7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions content/clause-interleaving.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 974a5d7

Please sign in to comment.