Add Machine::run_input_once() which reads one goal from user input and runs it

This commit is contained in:
Nicolas Luck
2023-07-11 14:24:30 +02:00
parent 95b31146b5
commit 112d398175
2 changed files with 7 additions and 0 deletions

View File

@@ -307,6 +307,10 @@ impl Machine {
self.run_module_predicate(atom!("$toplevel"), (atom!("$repl"), 1));
}
pub fn run_input_once(&mut self) {
self.run_module_predicate(atom!("$toplevel"), (atom!("run_input_once"), 0));
}
pub fn set_user_input(&mut self, input: String) {
self.user_input = Stream::from_owned_string(input, &mut self.machine_st.arena);
}