Skip to content

Commit 614812b

Browse files
committed
Also apply syntax changes in Parser comments
1 parent 6b04f15 commit 614812b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,7 @@ object Parsers {
18861886
* | `return' [Expr]
18871887
* | ForExpr
18881888
* | [SimpleExpr `.'] id `=' Expr
1889+
* | PrefixOperator SimpleExpr `=' Expr
18891890
* | SimpleExpr1 ArgumentExprs `=' Expr
18901891
* | PostfixExpr [Ascription]
18911892
* | ‘inline’ InfixExpr MatchClause
@@ -2206,8 +2207,9 @@ object Parsers {
22062207
isOperator = !(location.inArgs && followingIsVararg()),
22072208
maybePostfix = true)
22082209

2209-
/** PrefixExpr ::= [`-' | `+' | `~' | `!'] SimpleExpr
2210-
*/
2210+
/** PrefixExpr ::= [PrefixOperator'] SimpleExpr
2211+
* PrefixOperator ::= ‘-’ | ‘+’ | ‘~’ | ‘!’
2212+
*/
22112213
val prefixExpr: Location => Tree = location =>
22122214
if isIdent && nme.raw.isUnary(in.name)
22132215
&& in.canStartExprTokens.contains(in.lookahead.token)

0 commit comments

Comments
 (0)