File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -305,11 +305,15 @@ object Scanners {
305305 println(s " \n START SKIP AT ${sourcePos().line + 1 }, $this in $currentRegion" )
306306 var noProgress = 0
307307 // Defensive measure to ensure we always get out of the following while loop
308- // even if source file is weirly formatted (i.e. we never reach EOF
308+ // even if source file is weirly formatted (i.e. we never reach EOF)
309+ var prevOffset = offset
309310 while ! atStop && noProgress < 3 do
310- val prevOffset = offset
311311 nextToken()
312- if offset == prevOffset then noProgress += 1 else noProgress = 0
312+ if offset <= prevOffset then
313+ noProgress += 1
314+ else
315+ prevOffset = offset
316+ noProgress = 0
313317 if debugTokenStream then
314318 println(s " \n STOP SKIP AT ${sourcePos().line + 1 }, $this in $currentRegion" )
315319 if token == OUTDENT then dropUntil(_.isInstanceOf [Indented ])
You can’t perform that action at this time.
0 commit comments