reset current input in ReadQueryTerm
This commit is contained in:
@@ -540,7 +540,10 @@ impl Stream {
|
||||
|
||||
// returns true on success.
|
||||
#[inline]
|
||||
pub(super)
|
||||
fn reset(&mut self) -> bool {
|
||||
self.stream_inst.0.borrow_mut().0 = false;
|
||||
|
||||
match self.stream_inst.0.borrow_mut().1 {
|
||||
StreamInstance::Bytes(ref mut cursor) => {
|
||||
cursor.set_position(0);
|
||||
@@ -550,8 +553,7 @@ impl Stream {
|
||||
file.seek(SeekFrom::Start(0)).unwrap();
|
||||
true
|
||||
}
|
||||
StreamInstance::ReadlineStream(ref mut stream) => {
|
||||
*stream = ReadlineStream::new(String::new());
|
||||
StreamInstance::ReadlineStream(_) => {
|
||||
true
|
||||
}
|
||||
_ => {
|
||||
|
||||
@@ -4235,6 +4235,8 @@ impl MachineState {
|
||||
}
|
||||
}
|
||||
&SystemClauseType::ReadQueryTerm => {
|
||||
current_input_stream.reset();
|
||||
|
||||
readline::set_prompt(true);
|
||||
let result = self.read_term(current_input_stream.clone(), indices);
|
||||
readline::set_prompt(false);
|
||||
|
||||
Reference in New Issue
Block a user