We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7d893d commit eb2c406Copy full SHA for eb2c406
compiler/src/dotty/tools/dotc/parsing/Scanners.scala
@@ -682,13 +682,16 @@ object Scanners {
682
reset()
683
if atEOL then token = COLONeol
684
685
- // consume => and insert <indent> if applicable
+ // consume => and insert <indent> if applicable. Used to detect colon arrow: x =>
686
def observeArrowIndented(): Unit =
687
if isArrow && indentSyntax then
688
peekAhead()
689
- val atEOL = isAfterLineEnd || token == EOF
+ val atEOL = isAfterLineEnd
690
+ val atEOF = token == EOF
691
- if atEOL then
692
+ if atEOF then
693
+ token = EOF
694
+ else if atEOL then
695
val nextWidth = indentWidth(next.offset)
696
val lastWidth = currentRegion.indentWidth
697
if lastWidth < nextWidth then
0 commit comments