From 1c151f4a3fc53ece661c4eaab9892db34a979aee Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sat, 10 Aug 2019 21:36:26 +0200 Subject: [PATCH] remove dysfunctional repl --- compiler/src/prog8/CompilerMain.kt | 8 ------- compiler/src/prog8/repl/ReplMain.kt | 36 ----------------------------- 2 files changed, 44 deletions(-) delete mode 100644 compiler/src/prog8/repl/ReplMain.kt diff --git a/compiler/src/prog8/CompilerMain.kt b/compiler/src/prog8/CompilerMain.kt index 9851d8ffa..c045547d8 100644 --- a/compiler/src/prog8/CompilerMain.kt +++ b/compiler/src/prog8/CompilerMain.kt @@ -4,7 +4,6 @@ import prog8.ast.base.AstException import prog8.compiler.CompilationResult import prog8.compiler.compileProgram import prog8.parser.ParsingFailedError -import prog8.repl.Repl import prog8.vm.astvm.AstVm import java.nio.file.FileSystems import java.nio.file.Path @@ -37,7 +36,6 @@ private fun compileMain(args: Array) { var optimize = true var optimizeInlining = true var launchAstVm = false - var launchRepl = false var watchMode = false for (arg in args) { if(arg=="-emu") @@ -52,8 +50,6 @@ private fun compileMain(args: Array) { optimizeInlining = false else if(arg=="-avm") launchAstVm = true - else if(arg=="-repl") - launchRepl = true else if(arg=="-watch") watchMode = true else if(!arg.startsWith("-")) @@ -93,9 +89,6 @@ private fun compileMain(args: Array) { } } - } else if(launchRepl) { - val repl = Repl() - repl.loop() } else { if(moduleFile.isBlank()) usage() @@ -142,7 +135,6 @@ private fun usage() { System.err.println(" [-emu] auto-start the 'x64' C-64 emulator after successful compilation") System.err.println(" [-emu2] auto-start the 'x64sc' C-64 emulator after successful compilation") System.err.println(" [-avm] launch the prog8 ast-based virtual machine after compilation") - System.err.println(" [-repl] launch the prog8 REPL (interactive mode)") System.err.println(" [-watch] continuous compilation mode (watches for file changes)") System.err.println(" modulefile main module file to compile") exitProcess(1) diff --git a/compiler/src/prog8/repl/ReplMain.kt b/compiler/src/prog8/repl/ReplMain.kt deleted file mode 100644 index 3ed9d0cbd..000000000 --- a/compiler/src/prog8/repl/ReplMain.kt +++ /dev/null @@ -1,36 +0,0 @@ -package prog8.repl - -import prog8.compiler.compileProgram -import prog8.compiler.printAst -import java.io.File -import java.nio.file.Path - -class Repl() { - - - fun loop() { - println("~~totally unfinished experimental REPL~~\n") - while(true) { - print("> ") - val input = readLine() ?: break - val replmodule = createReplModule(input) - val compilationResult = compileProgram(replmodule, false, false, false) - printAst(compilationResult.programAst) - println("") - } - } - - private fun createReplModule(input: String): Path { - val replmodule = File("replmodule.p8") - replmodule.writeText(""" -%option enable_floats -main { - sub start() { - ${input.trim()} - } -} -""") - return replmodule.toPath() - } - -}