support loading of modules from files specified at the command line

This commit is contained in:
Mark Thom
2019-09-29 10:16:27 -06:00
parent e8bac464d0
commit 376b39a4ef
2 changed files with 8 additions and 0 deletions

View File

@@ -217,6 +217,13 @@ impl Machine {
}
pub fn run_toplevel(&mut self) {
use std::env;
use prolog::machine::compile::load_module_from_file;
for filename in env::args() {
load_module_from_file(self, &filename);
}
self.machine_st.p = CodePtr::Local(LocalCodePtr::DirEntry(self.toplevel_idx));
self.run_query(&AllocVarDict::new());
}