Some changes necessary to handle non-interactive code

This commit is contained in:
greg 2018-03-09 00:50:06 -08:00
parent b54c71633c
commit 6140de9f9c
3 changed files with 9 additions and 3 deletions

View File

@ -42,3 +42,5 @@ struct CompilerPass {
}
-change "Type...." names in parser.rs to "Anno..." for non-collision with names in typechecking.rs
-get rid of code pertaining to compilation specifically, have a more generation notion of "execution type"

View File

@ -18,7 +18,8 @@ pub struct EvalOptions {
#[derive(Debug, Default)]
pub struct LanguageOutput {
output: String,
artifacts: Vec<TraceArtifact>
artifacts: Vec<TraceArtifact>,
failed: bool,
}
impl LanguageOutput {
@ -91,6 +92,9 @@ impl TraceArtifact {
pub trait ProgrammingLanguageInterface {
fn evaluate_in_repl(&mut self, input: &str, eval_options: &EvalOptions) -> LanguageOutput;
fn evaluate_noninteractive(&mut self, input: &str, eval_options: &EvalOptions) -> LanguageOutput {
self.evaluate_in_repl(input, eval_options)
}
fn get_language_name(&self) -> String;
fn get_source_file_suffix(&self) -> String;
fn compile(&mut self, _input: &str) -> LLVMCodeString {

View File

@ -197,8 +197,8 @@ impl Repl {
fn input_handler(&mut self, input: &str) -> String {
let ref mut language = self.languages[self.current_language_index];
let interpretor_output = language.evaluate_in_repl(input, &self.options);
interpretor_output.to_string()
let interpreter_output = language.evaluate_in_repl(input, &self.options);
interpreter_output.to_string()
}
fn handle_interpreter_directive(&mut self, input: &str) -> bool {