@@ -43,7 +43,7 @@ trait Runner[Executable] {
43
43
* if module A depends on module B, then B should come before A.
44
44
* - Furthermore, each module mentioned here must import the `effekt` module as its first import.
45
45
*/
46
- def prelude : List [String ] = List (" effekt" )
46
+ def prelude : List [String ] = List (" effekt" , " option " , " list " , " result " , " exception " , " array " , " string " , " ref " , " bytearray " , " stringbuffer " , " splice " )
47
47
48
48
/**
49
49
* Creates a OS-specific script file that will execute the command when executed,
@@ -157,8 +157,6 @@ object JSNodeRunner extends Runner[String] {
157
157
158
158
override def includes (path : File ): List [File ] = List (path / " .." / " js" )
159
159
160
- override def prelude : List [String ] = List (" effekt" , " option" , " list" , " result" , " exception" , " array" , " string" , " ref" , " bytearray" , " stringbuffer" , " splice" )
161
-
162
160
def checkSetup (): Either [String , Unit ] =
163
161
if canRunExecutable(" node" , " --version" ) then Right (())
164
162
else Left (" Cannot find nodejs. This is required to use the JavaScript backend." )
@@ -190,16 +188,13 @@ object JSNodeRunner extends Runner[String] {
190
188
}
191
189
}
192
190
object JSWebRunner extends Runner [String ] {
193
- import scala .sys .process .Process
194
191
195
192
val extension = " js"
196
193
197
194
def standardLibraryPath (root : File ): File = root / " libraries" / " common"
198
195
199
196
override def includes (path : File ): List [File ] = List (path / " .." / " js" )
200
197
201
- override def prelude : List [String ] = List (" effekt" , " option" , " list" , " result" , " exception" , " array" , " string" , " ref" , " bytearray" , " stringbuffer" , " splice" )
202
-
203
198
def checkSetup (): Either [String , Unit ] =
204
199
Left (" Running js-web code directly is not supported. Use `--compile` to generate a js file / `--build` to generate a html file." )
205
200
@@ -208,7 +203,6 @@ object JSWebRunner extends Runner[String] {
208
203
* and then errors out, printing it's path.
209
204
*/
210
205
def build (path : String )(using C : Context ): String =
211
- import java .nio .file .Path
212
206
val out = C .config.outputPath().getAbsolutePath
213
207
val jsFilePath = (out / path).unixPath
214
208
val jsFileName = path.unixPath.split(" /" ).last
@@ -237,9 +231,7 @@ object JSWebRunner extends Runner[String] {
237
231
trait ChezRunner extends Runner [String ] {
238
232
val extension = " ss"
239
233
240
- def standardLibraryPath (root : File ): File = root / " libraries" / " common"
241
-
242
- override def prelude : List [String ] = List (" effekt" , " option" , " list" , " result" , " exception" , " array" , " string" , " bytearray" , " stringbuffer" , " splice" , " ref" )
234
+ def standardLibraryPath (root : File ): File = root / " libraries" / " common"
243
235
244
236
def checkSetup (): Either [String , Unit ] =
245
237
if canRunExecutable(" scheme" , " --help" ) then Right (())
@@ -270,17 +262,13 @@ object ChezCallCCRunner extends ChezRunner {
270
262
}
271
263
272
264
object LLVMRunner extends Runner [String ] {
273
- import scala .sys .process .Process
274
265
275
266
val extension = " ll"
276
267
277
268
def standardLibraryPath (root : File ): File = root / " libraries" / " common"
278
269
279
270
override def includes (path : File ): List [File ] = List (path / " .." / " llvm" )
280
271
281
- override def prelude : List [String ] = List (" effekt" , " option" , " list" , " result" , " exception" , " string" , " bytearray" , " stringbuffer" , " splice" ) // "array", "ref")
282
-
283
-
284
272
lazy val gccCmd = discoverExecutable(List (" cc" , " clang" , " gcc" ), List (" --version" ))
285
273
lazy val llcCmd = discoverExecutable(List (" llc" , " llc-15" , " llc-16" ), List (" --version" ))
286
274
lazy val optCmd = discoverExecutable(List (" opt" , " opt-15" , " opt-16" ), List (" --version" ))
0 commit comments