remove unnecessary parameter in compile_listing
This commit is contained in:
@@ -269,9 +269,7 @@ impl ListingCompiler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub
|
pub
|
||||||
fn compile_listing<R: Read>(wam: &mut Machine, src: R, mut indices: IndexStore,
|
fn compile_listing<R: Read>(wam: &mut Machine, src: R, mut indices: IndexStore) -> EvalSession
|
||||||
mut toplevel_indices: IndexStore)
|
|
||||||
-> EvalSession
|
|
||||||
{
|
{
|
||||||
let code_dir = wam.take_code_dir();
|
let code_dir = wam.take_code_dir();
|
||||||
let mut worker = TopLevelBatchWorker::new(src, wam.indices.atom_tbl.clone(),
|
let mut worker = TopLevelBatchWorker::new(src, wam.indices.atom_tbl.clone(),
|
||||||
@@ -280,6 +278,7 @@ fn compile_listing<R: Read>(wam: &mut Machine, src: R, mut indices: IndexStore,
|
|||||||
|
|
||||||
let mut compiler = ListingCompiler::new();
|
let mut compiler = ListingCompiler::new();
|
||||||
let mut toplevel_results = vec![];
|
let mut toplevel_results = vec![];
|
||||||
|
let mut toplevel_indices = default_index_store!(wam.indices.atom_tbl.clone());
|
||||||
|
|
||||||
while let Some(decl) = try_eval_session!(worker.consume(wam, &mut indices)) {
|
while let Some(decl) = try_eval_session!(worker.consume(wam, &mut indices)) {
|
||||||
if decl.is_module_decl() {
|
if decl.is_module_decl() {
|
||||||
@@ -319,10 +318,7 @@ fn setup_indices(wam: &Machine, indices: &mut IndexStore) -> Result<(), SessionE
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn compile_user_module<R: Read>(wam: &mut Machine, src: R) -> EvalSession {
|
pub fn compile_user_module<R: Read>(wam: &mut Machine, src: R) -> EvalSession {
|
||||||
let atom_tbl = wam.indices.atom_tbl.clone();
|
let mut indices = default_index_store!(wam.indices.atom_tbl.clone());
|
||||||
let mut indices = default_index_store!(atom_tbl.clone());
|
|
||||||
|
|
||||||
try_eval_session!(setup_indices(&wam, &mut indices));
|
try_eval_session!(setup_indices(&wam, &mut indices));
|
||||||
|
compile_listing(wam, src, indices)
|
||||||
compile_listing(wam, src, indices, default_index_store!(atom_tbl))
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,8 +222,7 @@ impl Machine {
|
|||||||
let atom_tbl = wam.indices.atom_tbl.clone();
|
let atom_tbl = wam.indices.atom_tbl.clone();
|
||||||
|
|
||||||
compile_listing(&mut wam, BUILTINS.as_bytes(),
|
compile_listing(&mut wam, BUILTINS.as_bytes(),
|
||||||
default_index_store!(atom_tbl.clone()),
|
default_index_store!(atom_tbl.clone()));
|
||||||
default_index_store!(atom_tbl));
|
|
||||||
|
|
||||||
compile_user_module(&mut wam, LISTS.as_bytes());
|
compile_user_module(&mut wam, LISTS.as_bytes());
|
||||||
compile_user_module(&mut wam, CONTROL.as_bytes());
|
compile_user_module(&mut wam, CONTROL.as_bytes());
|
||||||
|
|||||||
Reference in New Issue
Block a user