File tree 1 file changed +3
-2
lines changed
compiler/test/dotty/tools
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def assertThrows[T <: Throwable: ClassTag](p: T => Boolean)(body: => Any): Unit
45
45
end assertThrows
46
46
47
47
def toolArgsFor (files : List [JPath ])(using codec : Codec = Codec .UTF8 ): List [String ] =
48
- files.flatMap(path => toolArgsParse(readLines (path.toFile)))
48
+ files.flatMap(path => toolArgsParse(withFile (path.toFile)(_.getLines().take( 10 ).toList )))
49
49
50
50
// Inspect the first 10 of the given lines for compiler options of the form
51
51
// `// scalac: args`, `/* scalac: args`, ` * scalac: args`.
@@ -57,7 +57,8 @@ def toolArgsParse(lines: List[String]): List[String] = {
57
57
val endc = " *" + " /" // be forgiving of /* scalac: ... */
58
58
def stripped (s : String ) = s.substring(s.indexOf(tag) + tag.length).stripSuffix(endc)
59
59
val args = lines.to(LazyList ).take(10 ).filter { s =>
60
- s.contains(" // " + tag)
60
+ s.contains(" //" + tag)
61
+ || s.contains(" // " + tag)
61
62
|| s.contains(" /* " + tag)
62
63
|| s.contains(" * " + tag)
63
64
// but avoid picking up comments like "% scalac ./a.scala" and "$ scalac a.scala"
You can’t perform that action at this time.
0 commit comments