@@ -265,7 +265,7 @@ object Scanners {
265265 val next = newTokenData
266266 private val prev = newTokenData
267267
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. */
269269 var currentRegion : Region = Indented (IndentWidth .Zero , Set (), EMPTY , null )
270270
271271// Get next token ------------------------------------------------------------
@@ -434,8 +434,8 @@ object Scanners {
434434 && ! migrateTo3
435435 && ! noindentSyntax
436436
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 =
439439 import IndentWidth .{Run , Conc }
440440 def recur (idx : Int , ch : Char , n : Int , k : IndentWidth => IndentWidth ): IndentWidth =
441441 if (idx < 0 ) k(Run (ch, n))
@@ -452,7 +452,7 @@ object Scanners {
452452 else recur(idx - 1 , ' ' , 0 , identity)
453453 }
454454 recur(offset - 1 , ' ' , 0 , identity)
455- }
455+ end indentWidth
456456
457457 /** Handle newlines, possibly inserting an INDENT, OUTDENT, NEWLINE, or NEWLINES token
458458 * in front of the current token. This depends on whether indentation is significant or not.
@@ -521,6 +521,7 @@ object Scanners {
521521 lastWidth = r.width
522522 newlineIsSeparating = lastWidth <= nextWidth || r.isOutermost
523523 indentPrefix = r.prefix
524+ case _ : InString => ()
524525 case r =>
525526 indentIsSignificant = indentSyntax
526527 r.proposeKnownWidth(nextWidth, lastToken)
@@ -1424,7 +1425,7 @@ object Scanners {
14241425 nextToken()
14251426 currentRegion = topLevelRegion(indentWidth(offset))
14261427 }
1427- // end Scanner
1428+ end Scanner
14281429
14291430 /** A Region indicates what encloses the current token. It can be one of the following
14301431 *
0 commit comments