@@ -5,8 +5,10 @@ import java.nio.charset.StandardCharsets
55
66import dotty .tools .dotc .ast .Trees ._
77import dotty .tools .dotc .ast .{tpd , untpd }
8+ import dotty .tools .dotc .config .CommandLineParser .tokenize
89import dotty .tools .dotc .config .Properties .{javaVersion , javaVmName , simpleVersionString }
910import dotty .tools .dotc .core .Contexts ._
11+ import dotty .tools .dotc .core .Decorators ._
1012import dotty .tools .dotc .core .Phases .{unfusedPhases , typerPhase }
1113import dotty .tools .dotc .core .Denotations .Denotation
1214import dotty .tools .dotc .core .Flags ._
@@ -414,6 +416,23 @@ class ReplDriver(settings: Array[String],
414416 }
415417 state
416418
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+
417436 case Quit =>
418437 // end of the world!
419438 state
0 commit comments