File tree 2 files changed +6
-7
lines changed
compiler/src/dotty/tools/dotc/quoted 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,12 @@ class QuoteDriver extends Driver {
19
19
def run [T ](expr : Expr [T ], settings : Settings [Run ]): T = {
20
20
val (_, ctx : Context ) = setup(settings.compilerArgs.toArray :+ " dummy.scala" , initCtx.fresh)
21
21
22
- val outDir : AbstractFile = settings.compilerArgs.dropWhile(_ != " -d " ) match {
23
- case " -d " :: out :: _ =>
22
+ val outDir : AbstractFile = settings.outDir match {
23
+ case Some ( out) =>
24
24
val dir = Directory (out)
25
25
dir.createDirectory()
26
26
new PlainDirectory (Directory (out))
27
- case _ =>
27
+ case None =>
28
28
new VirtualDirectory (" (memory)" , None )
29
29
}
30
30
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ object Runners {
54
54
case _ => new QuoteDriver ().show(expr, settings)
55
55
}
56
56
57
- class Settings [T ] private (val compilerArgs : List [String ])
57
+ class Settings [T ] private (val outDir : Option [ String ], val compilerArgs : List [String ])
58
58
59
59
object Settings {
60
60
@@ -70,8 +70,7 @@ object Runners {
70
70
): Settings [Run ] = {
71
71
var compilerArgs1 = compilerArgs
72
72
if (optimise) compilerArgs1 = " -optimise" :: compilerArgs1
73
- if (outDir.nonEmpty) compilerArgs1 = " -d" :: outDir.get :: compilerArgs1
74
- new Settings (compilerArgs1)
73
+ new Settings (outDir, compilerArgs1)
75
74
}
76
75
77
76
/** Quote show settings
@@ -83,7 +82,7 @@ object Runners {
83
82
): Settings [Show ] = {
84
83
var compilerArgs1 = compilerArgs
85
84
compilerArgs1 = s " -color: ${if (color) " always" else " never" }" :: compilerArgs1
86
- new Settings (compilerArgs1)
85
+ new Settings (None , compilerArgs1)
87
86
}
88
87
89
88
}
You can’t perform that action at this time.
0 commit comments