major refactor

This commit is contained in:
Mark Thom
2018-05-15 22:47:36 -06:00
parent 8f1d721477
commit 06d896277c
22 changed files with 587 additions and 1276 deletions

View File

@@ -5,16 +5,13 @@ extern crate termion;
mod prolog;
use prolog::ast::*;
use prolog::compile::*;
use prolog::io::*;
use prolog::machine::*;
#[cfg(test)]
mod tests;
pub static LISTS: &str = include_str!("./prolog/lib/lists.pl");
pub static CONTROL: &str = include_str!("./prolog/lib/control.pl");
pub static QUEUES: &str = include_str!("./prolog/lib/queues.pl");
fn parse_and_compile_line(wam: &mut Machine, buffer: &str)
{
match parse_code(wam, buffer) {
@@ -29,11 +26,6 @@ fn parse_and_compile_line(wam: &mut Machine, buffer: &str)
fn prolog_repl() {
let mut wam = Machine::new();
load_init_str_and_include(&mut wam, BUILTINS, "builtins");
load_init_str(&mut wam, LISTS);
// load_init_str(&mut wam, CONTROL);
// load_init_str(&mut wam, QUEUES);
loop {
print!("prolog> ");