2017-08-31 19:18:56 -07:00
|
|
|
use language::{ProgrammingLanguageInterface, EvalOptions};
|
2017-08-29 04:15:31 -07:00
|
|
|
|
2017-08-29 04:27:07 -07:00
|
|
|
mod parsing;
|
|
|
|
|
2017-08-29 04:15:31 -07:00
|
|
|
pub struct Schala {
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Schala {
|
|
|
|
pub fn new() -> Schala {
|
|
|
|
Schala { }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-31 14:57:56 -07:00
|
|
|
impl ProgrammingLanguageInterface for Schala {
|
|
|
|
fn get_language_name(&self) -> String {
|
2017-08-29 04:15:31 -07:00
|
|
|
"Schala".to_string()
|
|
|
|
}
|
|
|
|
|
2017-08-31 16:26:55 -07:00
|
|
|
fn evaluate_in_repl(&mut self, input: &str, _eval_options: EvalOptions) -> Vec<String> {
|
|
|
|
let mut output = vec!(format!("test eval"));
|
|
|
|
|
|
|
|
let tokens = match parsing::tokenize(input) {
|
|
|
|
Ok(tokens) => tokens,
|
|
|
|
Err(e) => { output.push(format!("{}", e.msg));
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
let _ast = match parsing::parse(tokens) {
|
|
|
|
Ok(ast) => ast,
|
|
|
|
Err(e) => { output.push(format!("{}", e.msg));
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
output
|
2017-08-29 04:15:31 -07:00
|
|
|
}
|
|
|
|
}
|