Skip to content

Commit 96296ee

Browse files
committed
Change context-free syntax to reflect elimination of = _
1 parent 7aa56d4 commit 96296ee

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3189,7 +3189,8 @@ object Parsers {
31893189

31903190
/** PatDef ::= ids [‘:’ Type] ‘=’ Expr
31913191
* | Pattern2 [‘:’ Type] ‘=’ Expr
3192-
* VarDef ::= PatDef | id {`,' id} `:' Type `=' `_'
3192+
* VarDef ::= PatDef
3193+
* | id {`,' id} `:' Type `=' `_' (deprecated in 3.1)
31933194
* ValDcl ::= id {`,' id} `:' Type
31943195
* VarDcl ::= id {`,' id} `:' Type
31953196
*/

docs/docs/internals/syntax.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,12 @@ TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds
367367
[‘=’ Type]
368368
369369
Def ::= ‘val’ PatDef
370-
| ‘var’ VarDef
370+
| ‘var’ PatDef
371371
| ‘def’ DefDef
372372
| ‘type’ {nl} TypeDcl
373373
| TmplDef
374374
PatDef ::= ids [‘:’ Type] ‘=’ Expr
375375
| Pattern2 [‘:’ Type] ‘=’ Expr PatDef(_, pats, tpe?, expr)
376-
VarDef ::= PatDef
377-
| ids ‘:’ Type ‘=’ ‘_’
378376
DefDef ::= DefSig [‘:’ Type] ‘=’ Expr DefDef(_, name, tparams, vparamss, tpe, expr)
379377
| ‘this’ DefParamClause DefParamClauses ‘=’ ConstrExpr DefDef(_, <init>, Nil, vparamss, EmptyTree, expr | Block)
380378

docs/docs/reference/syntax.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,12 @@ DefSig ::= id [DefTypeParamClause] DefParamClauses
365365
TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds [‘=’ Type]
366366
367367
Def ::= ‘val’ PatDef
368-
| ‘var’ VarDef
368+
| ‘var’ PatDef
369369
| ‘def’ DefDef
370370
| ‘type’ {nl} TypeDcl
371371
| TmplDef
372372
PatDef ::= ids [‘:’ Type] ‘=’ Expr
373373
| Pattern2 [‘:’ Type] ‘=’ Expr
374-
VarDef ::= PatDef
375-
| ids ‘:’ Type ‘=’ ‘_’
376374
DefDef ::= DefSig [‘:’ Type] ‘=’ Expr
377375
| ‘this’ DefParamClause DefParamClauses ‘=’ ConstrExpr
378376

0 commit comments

Comments
 (0)