Open jurgenvinju opened 4 years ago
@maveme I'm reading TermRepl.java, which has code which uses fields not declared in util::REPL
; do you know what the state of this code is? Is there code on a branch which needs to be merged?
I really forgot what we were doing here ;-)
module util::REPL
import Message;
alias Completion
= tuple[int offset, list[str] suggestions];
data CommandResult(list[Message] messages = [])
= commandResult(str result)
;
data REPL
= repl(str title, str welcome, str prompt, loc history,
CommandResult (str line) handler,
Completion(str line, int cursor) completor)
| repl(
CommandResult (str line) handler,
Completion(str line, int cursor) completor)
;
@javaClass{org.rascalmpl.library.util.TermREPL}
@reflect
java void startREPL(REPL repl);
This is the current state, but the code uses fields like visualisation
too, and there is some salix integration as well.
Indeed. That code is being defined and used by Bacatá. Currently, I'm doing some changes together with @ltbinsbe. In the coming weeks, I'll clean this up, so the Bacatá-dependent code isn't part of the standalone REPL.
import salix::App;
extend util::REPL;
data CommandResult(list[Message] messages = [])
= salix(SalixApp[&T] salixApp)
;
data REPL(SalixMultiplexer visualization = noOp())
= repl(
CommandResult (str line) handler,
Completion(str line, int cursor) completor
)
| replization(
&T (str program, &T config) newHandler,
&T initConfig,
CommandResult (&T old, &T prev) printer
)
;
alias SalixConsumer
= VisOutput(SalixApp[value] app, str scope);
alias SalixMultiplexer
= tuple[SalixConsumer consumer, void() stop, loc http];
alias VisOutput = str;
This is the current state of the REPL in Bacatá
the demo of the Lisra repl here, as a consequence is also broken: demo::lang::Lisra::Console
On
startREPL
nothing happens. Sometime the current Rascal repl freezes and sometimes it returns without effect.