From 7360e698ddbf17d6f74b378f326432d7eaf1f26e Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 13 Mar 2019 10:10:42 -0700 Subject: [PATCH] More work --- schala-repl/src/language.rs | 10 +++++----- schala-repl/src/lib.rs | 3 +-- schala-repl/src/repl/mod.rs | 5 +++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/schala-repl/src/language.rs b/schala-repl/src/language.rs index 34af586..d7bad6a 100644 --- a/schala-repl/src/language.rs +++ b/schala-repl/src/language.rs @@ -189,29 +189,29 @@ pub trait ProgrammingLanguageInterface { } } -struct ComputationRequest { +pub struct ComputationRequest { pub source: String, pub debug_requests: Vec, } -struct ComputationResponse { +pub struct ComputationResponse { pub main_output: Result, pub global_output_stats: GlobalOutputStats, pub debug_responses: Vec, } -struct DebugRequest { +pub struct DebugRequest { kind: String, value: String } -struct DebugResponse { +pub struct DebugResponse { kind: String, value: String } #[derive(Default, Debug)] -struct GlobalOutputStats { +pub struct GlobalOutputStats { total_duration: Option, stage_durations: Option> } diff --git a/schala-repl/src/lib.rs b/schala-repl/src/lib.rs index 37c5e94..4d12354 100644 --- a/schala-repl/src/lib.rs +++ b/schala-repl/src/lib.rs @@ -39,8 +39,7 @@ pub fn start_repl(langs: Vec>) { exit(0); } - let mut repl = repl::NewRepl::new(); - + let mut repl = repl::NewRepl::new(langs); repl.run_repl(); } diff --git a/schala-repl/src/repl/mod.rs b/schala-repl/src/repl/mod.rs index 6f0aef0..7cbf2d3 100644 --- a/schala-repl/src/repl/mod.rs +++ b/schala-repl/src/repl/mod.rs @@ -16,16 +16,17 @@ const OPTIONS_SAVE_FILE: &'static str = ".schala_repl"; pub struct NewRepl { interpreter_directive_sigil: char, line_reader: ::linefeed::interface::Interface<::linefeed::terminal::DefaultTerminal>, + language_states: Vec>, } impl NewRepl { - pub fn new() -> NewRepl { + pub fn new(languages: Vec>) -> NewRepl { use linefeed::Interface; let line_reader = Interface::new("schala-repl").unwrap(); let interpreter_directive_sigil = ':'; NewRepl { - interpreter_directive_sigil, line_reader, + interpreter_directive_sigil, line_reader, language_states } }