Skip to content

Commit f83defe

Browse files
committed
.
1 parent 2fd9e0e commit f83defe

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

compiler/src/dotty/tools/dotc/parsing/Scanners.scala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)