@@ -265,7 +265,7 @@ object Scanners {
265
265
val next = newTokenData
266
266
private val prev = newTokenData
267
267
268
- /** The current region. This is initially an Indented region with indentation width. */
268
+ /** The current region. This is initially an Indented region with zero indentation width. */
269
269
var currentRegion : Region = Indented (IndentWidth .Zero , Set (), EMPTY , null )
270
270
271
271
// Get next token ------------------------------------------------------------
@@ -434,8 +434,8 @@ object Scanners {
434
434
&& ! migrateTo3
435
435
&& ! noindentSyntax
436
436
437
- /** The indentation width of the given offset */
438
- def indentWidth (offset : Offset ): IndentWidth = {
437
+ /** The indentation width of the given offset. */
438
+ def indentWidth (offset : Offset ): IndentWidth =
439
439
import IndentWidth .{Run , Conc }
440
440
def recur (idx : Int , ch : Char , n : Int , k : IndentWidth => IndentWidth ): IndentWidth =
441
441
if (idx < 0 ) k(Run (ch, n))
@@ -452,7 +452,7 @@ object Scanners {
452
452
else recur(idx - 1 , ' ' , 0 , identity)
453
453
}
454
454
recur(offset - 1 , ' ' , 0 , identity)
455
- }
455
+ end indentWidth
456
456
457
457
/** Handle newlines, possibly inserting an INDENT, OUTDENT, NEWLINE, or NEWLINES token
458
458
* in front of the current token. This depends on whether indentation is significant or not.
@@ -521,6 +521,7 @@ object Scanners {
521
521
lastWidth = r.width
522
522
newlineIsSeparating = lastWidth <= nextWidth || r.isOutermost
523
523
indentPrefix = r.prefix
524
+ case _ : InString => ()
524
525
case r =>
525
526
indentIsSignificant = indentSyntax
526
527
r.proposeKnownWidth(nextWidth, lastToken)
@@ -1422,7 +1423,7 @@ object Scanners {
1422
1423
nextToken()
1423
1424
currentRegion = topLevelRegion(indentWidth(offset))
1424
1425
}
1425
- // end Scanner
1426
+ end Scanner
1426
1427
1427
1428
/** A Region indicates what encloses the current token. It can be one of the following
1428
1429
*
0 commit comments