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(); let mut buf = String::new();
writeln!(buf, "`{}` - {}", dir.get_cmd(), dir.get_help()).unwrap(); writeln!(buf, "`{}` - {}", dir.get_cmd(), dir.get_help()).unwrap();
buf buf
}
}) })
} }
} }

View File

@ -25,26 +25,19 @@ pub struct Repl {
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<ProgrammingLanguageInterface>>,
options: ReplOptions, options: ReplOptions,
directives: CommandTree,
} }
impl Repl { impl Repl {
pub fn new(mut initial_states: Vec<Box<ProgrammingLanguageInterface>>) -> Repl { pub fn new(initial_states: Vec<Box<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 = ':';
let pass_names = match initial_states[0].request_meta(LangMetaRequest::StageNames) {
LangMetaResponse::StageNames(names) => names,
_ => vec![],
};
Repl { Repl {
interpreter_directive_sigil, interpreter_directive_sigil,
line_reader, line_reader,
language_states: initial_states, language_states: initial_states,
options: ReplOptions::new(), options: ReplOptions::new(),
directives: directives_from_pass_names(&pass_names)
} }
} }