@@ -5,8 +5,10 @@ import java.nio.charset.StandardCharsets
5
5
6
6
import dotty .tools .dotc .ast .Trees ._
7
7
import dotty .tools .dotc .ast .{tpd , untpd }
8
+ import dotty .tools .dotc .config .CommandLineParser .tokenize
8
9
import dotty .tools .dotc .config .Properties .{javaVersion , javaVmName , simpleVersionString }
9
10
import dotty .tools .dotc .core .Contexts ._
11
+ import dotty .tools .dotc .core .Decorators ._
10
12
import dotty .tools .dotc .core .Phases .{unfusedPhases , typerPhase }
11
13
import dotty .tools .dotc .core .Denotations .Denotation
12
14
import dotty .tools .dotc .core .Flags ._
@@ -414,6 +416,23 @@ class ReplDriver(settings: Array[String],
414
416
}
415
417
state
416
418
419
+ case Settings (arg) => arg match
420
+ case " " =>
421
+ given ctx : Context = state.context
422
+ for (s <- ctx.settings.userSetSettings(ctx.settingsState).sortBy(_.name))
423
+ out.println(s " ${s.name} = ${if s.value == " " then " \"\" " else s.value}" )
424
+ state
425
+ case _ =>
426
+ setup(tokenize(arg).toArray, rootCtx) match
427
+ case Some ((files, ictx)) =>
428
+ inContext(ictx) {
429
+ if files.nonEmpty then out.println(i " Ignoring spurious arguments: $files%, % " )
430
+ ictx.base.initialize()(using ictx)
431
+ rootCtx = ictx
432
+ }
433
+ case _ =>
434
+ state.copy(context = rootCtx)
435
+
417
436
case Quit =>
418
437
// end of the world!
419
438
state
0 commit comments