Fix some dyn's
This commit is contained in:
parent
6d3f5f4b81
commit
ca37e006b9
@ -51,7 +51,7 @@ pub fn start_repl(langs: Vec<Box<dyn ProgrammingLanguageInterface>>) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_noninteractive(filename: &str, languages: Vec<Box<ProgrammingLanguageInterface>>) {
|
fn run_noninteractive(filename: &str, languages: Vec<Box<dyn ProgrammingLanguageInterface>>) {
|
||||||
let path = Path::new(filename);
|
let path = Path::new(filename);
|
||||||
let ext = path.extension().and_then(|e| e.to_str()).unwrap_or_else(|| {
|
let ext = path.extension().and_then(|e| e.to_str()).unwrap_or_else(|| {
|
||||||
println!("Source file lacks extension");
|
println!("Source file lacks extension");
|
||||||
|
@ -23,12 +23,12 @@ type InterpreterDirectiveOutput = Option<String>;
|
|||||||
pub struct Repl {
|
pub struct Repl {
|
||||||
pub interpreter_directive_sigil: char,
|
pub interpreter_directive_sigil: char,
|
||||||
line_reader: ::linefeed::interface::Interface<::linefeed::terminal::DefaultTerminal>,
|
line_reader: ::linefeed::interface::Interface<::linefeed::terminal::DefaultTerminal>,
|
||||||
language_states: Vec<Box<ProgrammingLanguageInterface>>,
|
language_states: Vec<Box<dyn ProgrammingLanguageInterface>>,
|
||||||
options: ReplOptions,
|
options: ReplOptions,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Repl {
|
impl Repl {
|
||||||
pub fn new(initial_states: Vec<Box<ProgrammingLanguageInterface>>) -> Repl {
|
pub fn new(initial_states: Vec<Box<dyn ProgrammingLanguageInterface>>) -> Repl {
|
||||||
use linefeed::Interface;
|
use linefeed::Interface;
|
||||||
let line_reader = Interface::new("schala-repl").unwrap();
|
let line_reader = Interface::new("schala-repl").unwrap();
|
||||||
let interpreter_directive_sigil = ':';
|
let interpreter_directive_sigil = ':';
|
||||||
@ -113,7 +113,7 @@ impl Repl {
|
|||||||
directives.perform(self, &arguments)
|
directives.perform(self, &arguments)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_cur_language_state(&mut self) -> &mut Box<ProgrammingLanguageInterface> {
|
fn get_cur_language_state(&mut self) -> &mut Box<dyn ProgrammingLanguageInterface> {
|
||||||
//TODO this is obviously not complete
|
//TODO this is obviously not complete
|
||||||
&mut self.language_states[0]
|
&mut self.language_states[0]
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ use schala_repl::{ProgrammingLanguageInterface, start_repl};
|
|||||||
extern { }
|
extern { }
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let langs: Vec<Box<ProgrammingLanguageInterface>> = vec![Box::new(schala_lang::Schala::new())];
|
let langs: Vec<Box<dyn ProgrammingLanguageInterface>> = vec![Box::new(schala_lang::Schala::new())];
|
||||||
start_repl(langs);
|
start_repl(langs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user