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 {
8888 def isAfterLineEnd : Boolean = lineOffset >= 0
8989
9090 def isOperator =
91- token == IDENTIFIER && isOperatorPart(name(name.length - 1 ))
91+ token == BACKQUOTED_IDENT
92+ || token == IDENTIFIER && isOperatorPart(name(name.length - 1 ))
9293
9394 def isArrow =
9495 token == ARROW || token == CTXARROW
@@ -370,8 +371,7 @@ object Scanners {
370371 */
371372 def isLeadingInfixOperator (inConditional : Boolean = true ) =
372373 allowLeadingInfixOperators
373- && ( token == BACKQUOTED_IDENT
374- || token == IDENTIFIER && isOperatorPart(name(name.length - 1 )))
374+ && isOperator
375375 && (isWhitespace(ch) || ch == LF )
376376 && ! pastBlankLine
377377 && {
@@ -389,7 +389,7 @@ object Scanners {
389389 // leading infix operator.
390390 def assumeStartsExpr (lexeme : TokenData ) =
391391 canStartExprTokens.contains(lexeme.token)
392- && (token != BACKQUOTED_IDENT || ! lexeme.isOperator || nme.raw.isUnary(lexeme.name))
392+ && (! lexeme.isOperator || nme.raw.isUnary(lexeme.name))
393393 val lookahead = LookaheadScanner ()
394394 lookahead.allowLeadingInfixOperators = false
395395 // 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