Skip to content

Commit

Permalink
Resolve source code top-down rather than bottom-up.
Browse files Browse the repository at this point in the history
  • Loading branch information
eazar001 committed Feb 17, 2020
1 parent d42f0ea commit d42eff5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bfg-prolog"
version = "0.6.0"
version = "0.7.0"
authors = ["Ebrahim Azarisooreh <ebrahim.azarisooreh@gmail.com>"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ mod tests {
#[test]
fn test_unify_3_succeeds() {
let x = Term::Var(Var::new("X", 0));
let y = Term::Var(Var::new("Y", 0));;
let y = Term::Var(Var::new("Y", 0));

let env = Environment::new().unify_terms(&x, &y);
unification_result(&env.unwrap(), &mut [(Var::new("X", 0), y)]);
Expand All @@ -522,7 +522,7 @@ mod tests {
#[test]
fn test_unify_4_succeeds() {
let x1 = Term::Var(Var::new("X", 0));
let x2 = Term::Var(Var::new("X", 0));;
let x2 = Term::Var(Var::new("X", 0));

let env = Environment::new().unify_terms(&x1, &x2);
unification_result(&env.unwrap(), &mut []);
Expand Down
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ fn main() {

fn read_source_code(path: &str) -> Vec<Assertion> {
let s = read_to_string(String::from(path)).unwrap();
parse_code(&s)
let mut source = parse_code(&s);
source.reverse();

source
}

fn parse_code(code: &str) -> Vec<Assertion> {
Expand Down

0 comments on commit d42eff5

Please sign in to comment.