Skip to content

Commit 60a6bb4

Browse files
authored
Add flag to show prelude (#1032)
Solves #915 and allows some highlighting on `effekt-api`.
1 parent 011d224 commit 60a6bb4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

effekt/jvm/src/main/scala/effekt/EffektConfig.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ class EffektConfig(args: Seq[String]) extends REPLConfig(args.takeWhile(_ != "--
135135
// ---------
136136
private val debugging = group("Compiler Development")
137137

138+
val showPrelude: ScallopOption[Boolean] = toggle(
139+
"show-prelude",
140+
descrYes = "Print modules to be automatically imported in every file",
141+
default = Some(false),
142+
noshort = true,
143+
prefix = "no-",
144+
group = debugging
145+
)
146+
138147
val showIR: ScallopOption[Option[Stage]] = choice(
139148
choices = List("none", "core", "machine", "target"),
140149
name = "ir-show",

effekt/jvm/src/main/scala/effekt/Main.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ object Main {
2121
return
2222
}
2323

24-
if (config.server()) {
24+
if (config.showPrelude()) {
25+
println(config.prelude().mkString(","))
26+
} else if (config.server()) {
2527
val serverConfig = ServerConfig(
2628
debug = config.debug(),
2729
debugPort = config.debugPort()

0 commit comments

Comments
 (0)