Skip to content

Commit c1b17aa

Browse files
committed
Change context-free syntax to reflect elimination of = _
1 parent f073d15 commit c1b17aa

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

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

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

32023202
/** PatDef ::= ids [‘:’ Type] ‘=’ Expr
32033203
* | Pattern2 [‘:’ Type] ‘=’ Expr
3204-
* VarDef ::= PatDef | id {`,' id} `:' Type `=' `_'
3204+
* VarDef ::= PatDef
3205+
* | id {`,' id} `:' Type `=' `_' (deprecated in 3.1)
32053206
* ValDcl ::= id {`,' id} `:' Type
32063207
* VarDcl ::= id {`,' id} `:' Type
32073208
*/

docs/docs/internals/syntax.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,12 @@ TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds
384384
[‘=’ Type]
385385
386386
Def ::= ‘val’ PatDef
387-
| ‘var’ VarDef
387+
| ‘var’ PatDef
388388
| ‘def’ DefDef
389389
| ‘type’ {nl} TypeDcl
390390
| TmplDef
391391
PatDef ::= ids [‘:’ Type] ‘=’ Expr
392-
| Pattern2 [‘:’ Type] ‘=’ Expr PatDef(_, pats, tpe?, expr)
393-
VarDef ::= PatDef
394-
| ids ‘:’ Type ‘=’ ‘_’
392+
| Pattern2 [‘:’ Type] ‘=’ Expr PatDef(_, pats, tpe?, expr)
395393
DefDef ::= DefSig [‘:’ Type] ‘=’ Expr DefDef(_, name, tparams, vparamss, tpe, expr)
396394
| ‘this’ DefParamClause DefParamClauses ‘=’ ConstrExpr DefDef(_, <init>, Nil, vparamss, EmptyTree, expr | Block)
397395

docs/docs/reference/syntax.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,12 @@ DefSig ::= id [DefTypeParamClause] DefParamClauses
374374
TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds [‘=’ Type]
375375
376376
Def ::= ‘val’ PatDef
377-
| ‘var’ VarDef
377+
| ‘var’ PatDef
378378
| ‘def’ DefDef
379379
| ‘type’ {nl} TypeDcl
380380
| TmplDef
381381
PatDef ::= ids [‘:’ Type] ‘=’ Expr
382382
| Pattern2 [‘:’ Type] ‘=’ Expr
383-
VarDef ::= PatDef
384-
| ids ‘:’ Type ‘=’ ‘_’
385383
DefDef ::= DefSig [‘:’ Type] ‘=’ Expr
386384
| ‘this’ DefParamClause DefParamClauses ‘=’ ConstrExpr
387385

0 commit comments

Comments
 (0)