Add a new language - Rukka

This is a (simple) lisp, partially for fun, partially for testing the
generic interfaces
This commit is contained in:
greg 2017-11-26 21:17:17 -08:00
parent 66e3de41dd
commit c1e214c701
2 changed files with 26 additions and 0 deletions

View File

@ -10,6 +10,7 @@ extern crate maplit;
mod schala_lang; mod schala_lang;
mod maaru_lang; mod maaru_lang;
mod robo_lang; mod robo_lang;
mod rukka_lang;
extern crate schala_lib; extern crate schala_lib;
use schala_lib::{PLIGenerator, schala_main}; use schala_lib::{PLIGenerator, schala_main};
@ -22,6 +23,7 @@ fn main() {
Box::new(|| { Box::new(schala_lang::Schala::new())}), Box::new(|| { Box::new(schala_lang::Schala::new())}),
Box::new(|| { Box::new(maaru_lang::Maaru::new())}), Box::new(|| { Box::new(maaru_lang::Maaru::new())}),
Box::new(|| { Box::new(robo_lang::Robo::new())}), Box::new(|| { Box::new(robo_lang::Robo::new())}),
Box::new(|| { Box::new(rukka_lang::Rukka::new())}),
]; ];
schala_main(generators); schala_main(generators);
} }

24
src/rukka_lang/mod.rs Normal file
View File

@ -0,0 +1,24 @@
use itertools::Itertools;
use schala_lib::{ProgrammingLanguageInterface, EvalOptions, ReplOutput};
pub struct Rukka { }
impl Rukka {
pub fn new() -> Rukka { Rukka { } }
}
impl ProgrammingLanguageInterface for Rukka {
fn get_language_name(&self) -> String {
"Rukka".to_string()
}
fn get_source_file_suffix(&self) -> String {
format!("rukka")
}
fn evaluate_in_repl(&mut self, input: &str, _eval_options: &EvalOptions) -> ReplOutput {
let mut output = ReplOutput::default();
output.add_output(format!("Everything is ()"));
output
}
}