Add --no-add-history flag

Flag prevents the input stream from saving terms to ~/.scryer_history
when set. Use the flag when running tests to increase test isolation.
This commit is contained in:
William Kral
2022-03-10 21:48:41 -08:00
parent eace0d9b37
commit 5f1f07e5a1
7 changed files with 36 additions and 13 deletions

View File

@@ -1,3 +1,4 @@
pub mod args;
pub mod arithmetic_ops;
pub mod attributed_variables;
pub mod code_walker;
@@ -25,6 +26,7 @@ use crate::arithmetic::*;
use crate::atom_table::*;
use crate::forms::*;
use crate::instructions::*;
use crate::machine::args::*;
use crate::machine::compile::*;
use crate::machine::copier::*;
use crate::machine::heap::*;
@@ -396,9 +398,10 @@ impl Machine {
pub fn new() -> Self {
use ref_thread_local::RefThreadLocal;
let args = MachineArgs::new();
let mut machine_st = MachineState::new();
let user_input = Stream::stdin(&mut machine_st.arena);
let user_input = Stream::stdin(&mut machine_st.arena, args.add_history);
let user_output = Stream::stdout(&mut machine_st.arena);
let user_error = Stream::stderr(&mut machine_st.arena);