Tighten names in Language trait
This commit is contained in:
parent
7b7e20859f
commit
7e0acb7d87
@ -251,8 +251,13 @@ fn stage_names() -> Vec<&'static str> {
|
||||
|
||||
|
||||
impl ProgrammingLanguageInterface for Schala {
|
||||
fn get_language_name(&self) -> String { format!("Schala") }
|
||||
fn get_source_file_suffix(&self) -> String { format!("schala") }
|
||||
fn language_name(&self) -> String {
|
||||
"Schala".to_owned()
|
||||
}
|
||||
|
||||
fn source_file_suffix(&self) -> String {
|
||||
"schala".to_owned()
|
||||
}
|
||||
|
||||
fn run_computation(&mut self, request: ComputationRequest) -> ComputationResponse {
|
||||
struct PassToken<'a> {
|
||||
|
@ -2,8 +2,8 @@ use std::collections::HashSet;
|
||||
use std::time;
|
||||
|
||||
pub trait ProgrammingLanguageInterface {
|
||||
fn get_language_name(&self) -> String;
|
||||
fn get_source_file_suffix(&self) -> String;
|
||||
fn language_name(&self) -> String;
|
||||
fn source_file_suffix(&self) -> String;
|
||||
|
||||
fn run_computation(&mut self, _request: ComputationRequest) -> ComputationResponse {
|
||||
ComputationResponse {
|
||||
|
@ -44,7 +44,7 @@ pub fn run_noninteractive(filenames: Vec<PathBuf>, languages: Vec<Box<dyn Progra
|
||||
let mut language = Box::new(
|
||||
languages
|
||||
.into_iter()
|
||||
.find(|lang| lang.get_source_file_suffix() == ext)
|
||||
.find(|lang| lang.source_file_suffix() == ext)
|
||||
.unwrap_or_else(|| {
|
||||
println!("Extension .{} not recognized", ext);
|
||||
exit(1);
|
||||
|
@ -75,7 +75,7 @@ fn global_help(repl: &mut Repl) -> InterpreterDirectiveOutput {
|
||||
writeln!(
|
||||
buf,
|
||||
"Language-specific help for {}",
|
||||
lang.get_language_name()
|
||||
lang.language_name()
|
||||
)
|
||||
.unwrap();
|
||||
writeln!(buf, "-----------------------").unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user