Add a new language - Rukka
This is a (simple) lisp, partially for fun, partially for testing the generic interfaces
This commit is contained in:
parent
93d0cfe5b8
commit
da928db351
@ -10,6 +10,7 @@ extern crate maplit;
|
||||
mod schala_lang;
|
||||
mod maaru_lang;
|
||||
mod robo_lang;
|
||||
mod rukka_lang;
|
||||
|
||||
extern crate schala_lib;
|
||||
use schala_lib::{PLIGenerator, schala_main};
|
||||
@ -22,6 +23,7 @@ fn main() {
|
||||
Box::new(|| { Box::new(schala_lang::Schala::new())}),
|
||||
Box::new(|| { Box::new(maaru_lang::Maaru::new())}),
|
||||
Box::new(|| { Box::new(robo_lang::Robo::new())}),
|
||||
Box::new(|| { Box::new(rukka_lang::Rukka::new())}),
|
||||
];
|
||||
schala_main(generators);
|
||||
}
|
||||
|
24
src/rukka_lang/mod.rs
Normal file
24
src/rukka_lang/mod.rs
Normal 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
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user