File tree Expand file tree Collapse file tree 6 files changed +12
-12
lines changed
src/dotty/tools/dotc/reporting
doc-tool/src/dotty/tools/dottydoc Expand file tree Collapse file tree 6 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -91,15 +91,15 @@ trait MessageRendering {
9191 * @return aligned error message
9292 */
9393 def errorMsg (pos : SourcePosition , msg : String , offset : Int )(implicit ctx : Context ): String = {
94- val padding = msg.lines .foldLeft(pos.startColumnPadding) { (pad, line) =>
94+ val padding = msg.linesIterator .foldLeft(pos.startColumnPadding) { (pad, line) =>
9595 val lineLength = stripColor(line).length
9696 val maxPad = math.max(0 , ctx.settings.pageWidth.value - offset - lineLength) - offset
9797
9898 if (maxPad < pad.length) " " * maxPad
9999 else pad
100100 }
101101
102- msg.lines
102+ msg.linesIterator
103103 .map { line => " " * (offset - 1 ) + " |" + padding + line}
104104 .mkString(sys.props(" line.separator" ))
105105 }
Original file line number Diff line number Diff line change @@ -613,7 +613,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
613613 else runMain(testSource.runClassPath) match {
614614 case Success (_) if ! checkFile.isDefined || ! checkFile.get.exists => // success!
615615 case Success (output) => {
616- val outputLines = output.lines .toArray :+ DiffUtil .EOF
616+ val outputLines = output.linesIterator .toArray :+ DiffUtil .EOF
617617 val checkLines : Array [String ] = Source .fromFile(checkFile.get).getLines().toArray :+ DiffUtil .EOF
618618 val sourceTitle = testSource.title
619619
@@ -1027,7 +1027,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
10271027 case test.TimeoutFailure (title) =>
10281028 s " - test ' $title' timed out "
10291029 case test.JavaCompilationFailure (msg) =>
1030- s " - java compilation failed with: \n ${ msg.lines .map(" " + _).mkString(" \n " ) }"
1030+ s " - java compilation failed with: \n ${ msg.linesIterator .map(" " + _).mkString(" \n " ) }"
10311031 }.mkString(" \n " )
10321032 }
10331033
Original file line number Diff line number Diff line change @@ -21,6 +21,6 @@ trait CommentCleaner {
2121 SafeTags .replaceAllIn(javadoclessComment, { mtch =>
2222 Matcher .quoteReplacement(safeTagMarker + mtch.matched + safeTagMarker)
2323 })
24- markedTagComment.lines .toList map (cleanLine)
24+ markedTagComment.linesIterator .toList map (cleanLine)
2525 }
2626}
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ trait Page {
115115 val withoutYaml = virtualFile(
116116 if (content.startsWith(" ---\n " )) {
117117 val str =
118- content.lines
118+ content.linesIterator
119119 .drop(1 )
120120 .dropWhile(line => line != " ---" && line != " ..." )
121121 .drop(1 ).mkString(" \n " )
Original file line number Diff line number Diff line change @@ -75,11 +75,11 @@ object RichStringTest1 extends RichTest {
7575object RichStringTest2 extends RichTest {
7676 def run : Unit = {
7777 println(" \n " + getObjectName + " :" )
78- Console .print(" s1: " ); s1.lines foreach println
79- Console .print(" s2: " ); s2.lines foreach println
80- Console .print(" s3: " ); s3.lines foreach println
81- Console .print(" s4: " ); s4.lines foreach println
82- Console .print(" s5: " ); s5.lines foreach println
78+ Console .print(" s1: " ); s1.linesIterator foreach println
79+ Console .print(" s2: " ); s2.linesIterator foreach println
80+ Console .print(" s3: " ); s3.linesIterator foreach println
81+ Console .print(" s4: " ); s4.linesIterator foreach println
82+ Console .print(" s5: " ); s5.linesIterator foreach println
8383 }
8484}
8585object RichStringTest3 extends RichTest {
Original file line number Diff line number Diff line change 22object Test extends dotty.runtime.LegacyApp {
33 val ms = """ This is a long multiline string
44 with \u000d\u000a CRLF embedded."""
5- assert(ms.lines .size == 3 , s " lines.size ${ms.lines .size}" )
5+ assert(ms.linesIterator .size == 3 , s " lines.size ${ms.linesIterator .size}" )
66 assert(ms contains " \r\n CRLF" , " no CRLF" )
77}
You can’t perform that action at this time.
0 commit comments