Remove unneeded directives field

This commit is contained in:
greg 2019-06-06 23:52:41 -07:00
parent 5271429715
commit 83e05fe382
2 changed files with 2 additions and 8 deletions

View File

@ -15,6 +15,7 @@ pub fn help(repl: &mut Repl, arguments: &[&str]) -> InterpreterDirectiveOutput {
let mut buf = String::new();
writeln!(buf, "`{}` - {}", dir.get_cmd(), dir.get_help()).unwrap();
buf
}
})
}
}

View File

@ -25,26 +25,19 @@ pub struct Repl {
line_reader: ::linefeed::interface::Interface<::linefeed::terminal::DefaultTerminal>,
language_states: Vec<Box<ProgrammingLanguageInterface>>,
options: ReplOptions,
directives: CommandTree,
}
impl Repl {
pub fn new(mut initial_states: Vec<Box<ProgrammingLanguageInterface>>) -> Repl {
pub fn new(initial_states: Vec<Box<ProgrammingLanguageInterface>>) -> Repl {
use linefeed::Interface;
let line_reader = Interface::new("schala-repl").unwrap();
let interpreter_directive_sigil = ':';
let pass_names = match initial_states[0].request_meta(LangMetaRequest::StageNames) {
LangMetaResponse::StageNames(names) => names,
_ => vec![],
};
Repl {
interpreter_directive_sigil,
line_reader,
language_states: initial_states,
options: ReplOptions::new(),
directives: directives_from_pass_names(&pass_names)
}
}