Fix some dyn's

This commit is contained in:
greg 2019-06-21 02:01:46 -07:00
parent 6d3f5f4b81
commit ca37e006b9
3 changed files with 5 additions and 5 deletions

View File

@ -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 ext = path.extension().and_then(|e| e.to_str()).unwrap_or_else(|| {
println!("Source file lacks extension");

View File

@ -23,12 +23,12 @@ type InterpreterDirectiveOutput = Option<String>;
pub struct Repl {
pub interpreter_directive_sigil: char,
line_reader: ::linefeed::interface::Interface<::linefeed::terminal::DefaultTerminal>,
language_states: Vec<Box<ProgrammingLanguageInterface>>,
language_states: Vec<Box<dyn ProgrammingLanguageInterface>>,
options: ReplOptions,
}
impl Repl {
pub fn new(initial_states: Vec<Box<ProgrammingLanguageInterface>>) -> Repl {
pub fn new(initial_states: Vec<Box<dyn ProgrammingLanguageInterface>>) -> Repl {
use linefeed::Interface;
let line_reader = Interface::new("schala-repl").unwrap();
let interpreter_directive_sigil = ':';
@ -113,7 +113,7 @@ impl Repl {
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
&mut self.language_states[0]
}

View File

@ -9,7 +9,7 @@ use schala_repl::{ProgrammingLanguageInterface, start_repl};
extern { }
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);
}