File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -1363,7 +1363,9 @@ object Parsers {
13631363 closingIndent : String ,
13641364 isFirstPart : Boolean ,
13651365 isLastPart : Boolean ): String = {
1366-
1366+ // Just explicitly do nothing when the `closingIndent` is empty. This is easier than trying
1367+ // to ensure that handling of the various `linesIterator`/`linesWithSeparators`/etc.
1368+ // APIs behaves predictably in the presence of empty leading/trailing lines
13671369 if (closingIndent == " " ) str
13681370 else {
13691371 // Check for mixed tabs and spaces in closing indent
Original file line number Diff line number Diff line change @@ -1288,18 +1288,6 @@ object Scanners {
12881288 else error(em " unclosed string literal " )
12891289 }
12901290
1291- /** Parse a dedented string literal (triple single quotes)
1292- * Requirements:
1293- * - Must start with ''' followed by newline
1294- * - Must end with newline + whitespace + '''
1295- * - Removes first newline after opening delimiter
1296- * - Removes final newline and preceding whitespace before closing delimiter
1297- * - Strips indentation equal to closing delimiter indentation
1298- * - All lines must be empty or indented further than closing delimiter
1299- * - Supports extended delimiters (e.g., '''', ''''')
1300- * @param isInterpolated If true, handles $ interpolation and returns STRINGPART tokens
1301- * @return The quote count (number of quotes in the delimiter) for storing in the region
1302- */
13031291 private def getDedentedString (isInterpolated : Boolean ): Int = {
13041292 // For interpolated strings, we're already at the first character after '''
13051293 // For non-interpolated, we need to consume the first character
You can’t perform that action at this time.
0 commit comments