File tree 1 file changed +7
-3
lines changed
compiler/src/dotty/tools/dotc/parsing
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -305,11 +305,15 @@ object Scanners {
305
305
println(s " \n START SKIP AT ${sourcePos().line + 1 }, $this in $currentRegion" )
306
306
var noProgress = 0
307
307
// 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
309
310
while ! atStop && noProgress < 3 do
310
- val prevOffset = offset
311
311
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
313
317
if debugTokenStream then
314
318
println(s " \n STOP SKIP AT ${sourcePos().line + 1 }, $this in $currentRegion" )
315
319
if token == OUTDENT then dropUntil(_.isInstanceOf [Indented ])
You can’t perform that action at this time.
0 commit comments