Remove unused global_env cache
@@ -54,22 +54,6 @@ pub struct Program {
file_cache: HashMap<String, FileId>,
/// Cache storing parsed terms corresponding to the entries of the file database.
term_cache: HashMap<FileId, RichTerm>,
- /// The global environment, containing the standard lib.
- global_env: GlobalEnvironment,
-}
-
-#[derive(Debug, Clone)]
-pub enum GlobalEnvironment {
- None,
- Loaded(eval::Environment),
- Transformed(eval::Environment),
- Typechecked(eval::Environment),
-}
-
-impl std::default::Default for GlobalEnvironment {
- fn default() -> Self {
- GlobalEnvironment::None
- }
}
/// Return status indicating if an import has been resolved from a file (first encounter), or was
@@ -132,12 +116,6 @@ impl Program {
Program::new_from_source(io::stdin(), "<stdin>")
}
- /// Create a program by reading from a file.
- pub fn new_from_file<P: AsRef<Path>>(path: P) -> std::io::Result<Program> {
- let file = fs::File::open(&path)?;
- Program::new_from_source(file, path.as_ref())
- }
-
/// Create a program by reading it from a generic source.
pub fn new_from_source<T: Read>(
mut source: T,
@@ -154,7 +132,6 @@ impl Program {
files,
file_cache: HashMap::new(),
term_cache: HashMap::new(),
- global_env: GlobalEnvironment::default(),
})
}
@@ -1540,6 +1517,7 @@ Assume(#alwaysTrue -> #alwaysFalse, not ) true
"\"ignore\n\n empty line indent\""
);
+ // /!\ Trailing spaces on the middle line are on purpose, don't remove ! /!\
assert_peq!(
r##"
m#"
