File tree 2 files changed +4
-4
lines changed
compiler/src/dotty/tools/dotc
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -337,15 +337,15 @@ object Scanners {
337
337
338
338
/** A leading symbolic or backquoted identifier is treated as an infix operator if
339
339
* - it does not follow a blank line, and
340
- * - it is followed on the same line by at least one ' '
341
- * and a token that can start an expression.
340
+ * - it is followed by at least one whitespace character and a
341
+ * token that can start an expression.
342
342
* If a leading infix operator is found and the source version is `3.0-migration`, emit a change warning.
343
343
*/
344
344
def isLeadingInfixOperator (inConditional : Boolean = true ) =
345
345
allowLeadingInfixOperators
346
346
&& ( token == BACKQUOTED_IDENT
347
347
|| token == IDENTIFIER && isOperatorPart(name(name.length - 1 )))
348
- && ch <= ' '
348
+ && isWhitespace(ch)
349
349
&& ! pastBlankLine
350
350
&& {
351
351
val lookahead = LookaheadScanner ()
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ object Chars {
52
52
53
53
/** Is character a whitespace character (but not a new line)? */
54
54
def isWhitespace (c : Char ): Boolean =
55
- c == ' ' || c == '\t ' || c == CR
55
+ c == ' ' || c == '\t ' || c == CR || c == LF
56
56
57
57
/** Can character form part of a doc comment variable $xxx? */
58
58
def isVarPart (c : Char ): Boolean =
You can’t perform that action at this time.
0 commit comments