File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,8 @@ object Scanners {
88
88
def isAfterLineEnd : Boolean = lineOffset >= 0
89
89
90
90
def isOperator =
91
- token == IDENTIFIER && isOperatorPart(name(name.length - 1 ))
91
+ token == BACKQUOTED_IDENT
92
+ || token == IDENTIFIER && isOperatorPart(name(name.length - 1 ))
92
93
93
94
def isArrow =
94
95
token == ARROW || token == CTXARROW
@@ -370,8 +371,7 @@ object Scanners {
370
371
*/
371
372
def isLeadingInfixOperator (inConditional : Boolean = true ) =
372
373
allowLeadingInfixOperators
373
- && ( token == BACKQUOTED_IDENT
374
- || token == IDENTIFIER && isOperatorPart(name(name.length - 1 )))
374
+ && isOperator
375
375
&& (isWhitespace(ch) || ch == LF )
376
376
&& ! pastBlankLine
377
377
&& {
@@ -389,7 +389,7 @@ object Scanners {
389
389
// leading infix operator.
390
390
def assumeStartsExpr (lexeme : TokenData ) =
391
391
canStartExprTokens.contains(lexeme.token)
392
- && (token != BACKQUOTED_IDENT || ! lexeme.isOperator || nme.raw.isUnary(lexeme.name))
392
+ && (! lexeme.isOperator || nme.raw.isUnary(lexeme.name))
393
393
val lookahead = LookaheadScanner ()
394
394
lookahead.allowLeadingInfixOperators = false
395
395
// force a NEWLINE a after current token if it is on its own line
You can’t perform that action at this time.
0 commit comments