Add source file suffix to trait

This commit is contained in:
greg 2017-10-02 23:07:05 -07:00
parent 00ee802fbd
commit 65f64ebcc2
4 changed files with 12 additions and 0 deletions

View File

@ -99,6 +99,7 @@ impl TraceArtifact {
pub trait ProgrammingLanguageInterface { pub trait ProgrammingLanguageInterface {
fn evaluate_in_repl(&mut self, input: &str, eval_options: &EvalOptions) -> ReplOutput; fn evaluate_in_repl(&mut self, input: &str, eval_options: &EvalOptions) -> ReplOutput;
fn get_language_name(&self) -> String; fn get_language_name(&self) -> String;
fn get_source_file_suffix(&self) -> String;
fn compile(&mut self, _input: &str) -> LLVMCodeString { fn compile(&mut self, _input: &str) -> LLVMCodeString {
LLVMCodeString("".to_string()) LLVMCodeString("".to_string())
} }

View File

@ -23,6 +23,9 @@ impl<'a> ProgrammingLanguageInterface for Maaru<'a> {
fn get_language_name(&self) -> String { fn get_language_name(&self) -> String {
"Maaru".to_string() "Maaru".to_string()
} }
fn get_source_file_suffix(&self) -> String {
format!("maaru")
}
fn evaluate_in_repl(&mut self, input: &str, options: &EvalOptions) -> ReplOutput { fn evaluate_in_repl(&mut self, input: &str, options: &EvalOptions) -> ReplOutput {
let mut output = ReplOutput::default(); let mut output = ReplOutput::default();

View File

@ -136,6 +136,10 @@ impl ProgrammingLanguageInterface for Robo {
"Robo".to_string() "Robo".to_string()
} }
fn get_source_file_suffix(&self) -> String {
format!("robo")
}
fn evaluate_in_repl(&mut self, input: &str, _eval_options: &EvalOptions) -> ReplOutput { fn evaluate_in_repl(&mut self, input: &str, _eval_options: &EvalOptions) -> ReplOutput {
let mut output = ReplOutput::default(); let mut output = ReplOutput::default();
let tokens = match tokenize(input) { let tokens = match tokenize(input) {

View File

@ -23,6 +23,10 @@ impl ProgrammingLanguageInterface for Schala {
"Schala".to_string() "Schala".to_string()
} }
fn get_source_file_suffix(&self) -> String {
format!("schala")
}
fn evaluate_in_repl(&mut self, input: &str, options: &EvalOptions) -> ReplOutput { fn evaluate_in_repl(&mut self, input: &str, options: &EvalOptions) -> ReplOutput {
let mut output = ReplOutput::default(); let mut output = ReplOutput::default();
let tokens = parsing::tokenize(input); let tokens = parsing::tokenize(input);