Skip to content

Commit ac20ba5

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

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
@@ -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: 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)