From 2974ab23adeaaa9d165b0b14b43f76a3d93104f5 Mon Sep 17 00:00:00 2001 From: odersky Date: Thu, 3 Apr 2025 16:07:57 +0200 Subject: [PATCH 1/2] Rename Typelessclause to something easier to understand --- docs/_docs/internals/syntax.md | 6 +++--- docs/_docs/reference/syntax.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/_docs/internals/syntax.md b/docs/_docs/internals/syntax.md index 665b4f5144ba..6c144f436690 100644 --- a/docs/_docs/internals/syntax.md +++ b/docs/_docs/internals/syntax.md @@ -387,8 +387,8 @@ DefParamClauses ::= DefParamClause { DefParamClause } -- and two DefTypeParam DefParamClause ::= DefTypeParamClause | DefTermParamClause | UsingParamClause -TypelessClauses ::= TypelessClause {TypelessClause} -TypelessClause ::= DefTermParamClause +ConstrParamClauses::= ConstrParamClause {ConstrParamClause} +ConstrParamClause ::= DefTermParamClause | UsingParamClause DefTermParamClause::= [nl] ‘(’ [DefTermParams] ‘)’ UsingParamClause ::= [nl] ‘(’ ‘using’ (DefTermParams | FunArgTypes) ‘)’ @@ -459,7 +459,7 @@ Def ::= ‘val’ PatDef PatDef ::= ids [‘:’ Type] [‘=’ Expr] | Pattern2 [‘:’ Type] [‘=’ Expr] PatDef(_, pats, tpe?, expr) DefDef ::= DefSig [‘:’ Type] [‘=’ Expr] DefDef(_, name, paramss, tpe, expr) - | ‘this’ TypelessClauses [DefImplicitClause] ‘=’ ConstrExpr DefDef(_, , vparamss, EmptyTree, expr | Block) + | ‘this’ ConstrParamClauses [DefImplicitClause] ‘=’ ConstrExpr DefDef(_, , vparamss, EmptyTree, expr | Block) DefSig ::= id [DefParamClauses] [DefImplicitClause] TypeDef ::= id [HkTypeParamClause] {FunParamClause} TypeAndCtxBounds TypeDefTree(_, name, tparams, bound [‘=’ Type] diff --git a/docs/_docs/reference/syntax.md b/docs/_docs/reference/syntax.md index 0f78ff03583e..ccba2ec9578a 100644 --- a/docs/_docs/reference/syntax.md +++ b/docs/_docs/reference/syntax.md @@ -363,8 +363,8 @@ DefParamClauses ::= DefParamClause { DefParamClause } -- and two DefTypeParam DefParamClause ::= DefTypeParamClause | DefTermParamClause | UsingParamClause -TypelessClauses ::= TypelessClause {TypelessClause} -TypelessClause ::= DefTermParamClause +ConstrParamClauses::= ConstrParamClause {ConstrParamClause} +ConstrParamClause ::= DefTermParamClause | UsingParamClause DefTermParamClause::= [nl] ‘(’ [DefTermParams] ‘)’ @@ -433,7 +433,7 @@ Def ::= ‘val’ PatDef PatDef ::= ids [‘:’ Type] [‘=’ Expr] | Pattern2 [‘:’ Type] [‘=’ Expr] PatDef(_, pats, tpe?, expr) DefDef ::= DefSig [‘:’ Type] [‘=’ Expr] DefDef(_, name, paramss, tpe, expr) - | ‘this’ TypelessClauses [DefImplicitClause] ‘=’ ConstrExpr DefDef(_, , vparamss, EmptyTree, expr | Block) + | ‘this’ ConstrParamClauses [DefImplicitClause] ‘=’ ConstrExpr DefDef(_, , vparamss, EmptyTree, expr | Block) DefSig ::= id [DefParamClauses] [DefImplicitClause] TypeDef ::= id [HkTypeParamClause] {FunParamClause}TypeBounds TypeDefTree(_, name, tparams, bound [‘=’ Type] From 4e5d0389f59c50bc2003b971105af6dafda664b2 Mon Sep 17 00:00:00 2001 From: odersky Date: Sun, 6 Apr 2025 21:50:33 +0200 Subject: [PATCH 2/2] Rename also in parser --- compiler/src/dotty/tools/dotc/parsing/Parsers.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index c24dbce1b6ac..3a42b8a682f1 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -3555,7 +3555,7 @@ object Parsers { * ClsParams ::= ClsParam {‘,’ ClsParam} * ClsParam ::= {Annotation} * [{Modifier} (‘val’ | ‘var’)] Param - * TypelessClause ::= DefTermParamClause + * ConstrParamClause ::= DefTermParamClause * | UsingParamClause * * DefTermParamClause::= [nl] ‘(’ [DefTermParams] ‘)’ @@ -3681,7 +3681,7 @@ object Parsers { } /** ClsTermParamClauses ::= {ClsTermParamClause} [[nl] ‘(’ [‘implicit’] ClsParams ‘)’] - * TypelessClauses ::= TypelessClause {TypelessClause} + * ConstrParamClauses ::= ConstrParamClause {ConstrParamClause} * * @return The parameter definitions */ @@ -3955,7 +3955,7 @@ object Parsers { } /** DefDef ::= DefSig [‘:’ Type] [‘=’ Expr] - * | this TypelessClauses [DefImplicitClause] `=' ConstrExpr + * | this ConstrParamClauses [DefImplicitClause] `=' ConstrExpr * DefSig ::= id [DefParamClauses] [DefImplicitClause] */ def defDefOrDcl(start: Offset, mods: Modifiers, numLeadParams: Int = 0): DefDef = atSpan(start, nameStart) {