major refactor.

This commit is contained in:
Mark Thom
2018-02-25 12:13:07 -07:00
parent 05c1275acf
commit cf9db43d5b
20 changed files with 735 additions and 813 deletions

View File

@@ -1,5 +1,4 @@
use prolog::ast::*;
use prolog::tabled_rc::*;
use std::collections::{HashMap, VecDeque};
use std::hash::Hash;
@@ -12,7 +11,7 @@ enum IntIndex {
pub struct CodeOffsets {
pub constants: HashMap<Constant, ThirdLevelIndex>,
pub lists: ThirdLevelIndex,
pub structures: HashMap<(TabledRc<Atom>, usize), ThirdLevelIndex>
pub structures: HashMap<(ClauseName, usize), ThirdLevelIndex>
}
impl CodeOffsets {
@@ -145,7 +144,7 @@ impl CodeOffsets {
}
}
fn switch_on_structure(str_ind: HashMap<(TabledRc<Atom>, usize), ThirdLevelIndex>,
fn switch_on_structure(str_ind: HashMap<(ClauseName, usize), ThirdLevelIndex>,
prelude: &mut CodeDeque)
-> IntIndex
{