From 65f64ebcc2388535df94b152fa1ec7307790621c Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 2 Oct 2017 23:07:05 -0700 Subject: [PATCH] Add source file suffix to trait --- src/language.rs | 1 + src/maaru_lang/mod.rs | 3 +++ src/robo_lang/mod.rs | 4 ++++ src/schala_lang/mod.rs | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/src/language.rs b/src/language.rs index 84b4c13..06a94b1 100644 --- a/src/language.rs +++ b/src/language.rs @@ -99,6 +99,7 @@ impl TraceArtifact { pub trait ProgrammingLanguageInterface { fn evaluate_in_repl(&mut self, input: &str, eval_options: &EvalOptions) -> ReplOutput; fn get_language_name(&self) -> String; + fn get_source_file_suffix(&self) -> String; fn compile(&mut self, _input: &str) -> LLVMCodeString { LLVMCodeString("".to_string()) } diff --git a/src/maaru_lang/mod.rs b/src/maaru_lang/mod.rs index 178f0ae..4ab810d 100644 --- a/src/maaru_lang/mod.rs +++ b/src/maaru_lang/mod.rs @@ -23,6 +23,9 @@ impl<'a> ProgrammingLanguageInterface for Maaru<'a> { fn get_language_name(&self) -> String { "Maaru".to_string() } + fn get_source_file_suffix(&self) -> String { + format!("maaru") + } fn evaluate_in_repl(&mut self, input: &str, options: &EvalOptions) -> ReplOutput { let mut output = ReplOutput::default(); diff --git a/src/robo_lang/mod.rs b/src/robo_lang/mod.rs index 76a0043..1092155 100644 --- a/src/robo_lang/mod.rs +++ b/src/robo_lang/mod.rs @@ -136,6 +136,10 @@ impl ProgrammingLanguageInterface for Robo { "Robo".to_string() } + fn get_source_file_suffix(&self) -> String { + format!("robo") + } + fn evaluate_in_repl(&mut self, input: &str, _eval_options: &EvalOptions) -> ReplOutput { let mut output = ReplOutput::default(); let tokens = match tokenize(input) { diff --git a/src/schala_lang/mod.rs b/src/schala_lang/mod.rs index 7a24cb8..8410284 100644 --- a/src/schala_lang/mod.rs +++ b/src/schala_lang/mod.rs @@ -23,6 +23,10 @@ impl ProgrammingLanguageInterface for Schala { "Schala".to_string() } + fn get_source_file_suffix(&self) -> String { + format!("schala") + } + fn evaluate_in_repl(&mut self, input: &str, options: &EvalOptions) -> ReplOutput { let mut output = ReplOutput::default(); let tokens = parsing::tokenize(input);