Idea for trait redesign

This commit is contained in:
greg 2017-08-30 19:09:22 -07:00
parent 192a7e611f
commit 626b17cbd2

View File

@ -94,3 +94,25 @@ impl<PL, T, A, E> LanguageInterface for (PL, PL::Evaluator) where PL: Programmin
output output
} }
} }
/* below here is new versions of everything */
#[derive(Debug, PartialEq)]
pub struct EvalStage {
index: u8,
name: String,
}
pub struct EvalOptions {
debug_stages: Vec<EvalStage>,
}
pub trait ProgrammingLanguageInterface {
fn evaluate_in_repl(&mut self, input: &str, eval_options: EvalOptions);
fn get_language_name(&self) -> String;
fn get_stages(&self) -> Vec<u8>;
}
pub trait CompileableLanguage : ProgrammingLanguageInterface {
fn compile(&mut self);
}