[[package]]
name = "prolog_parser"
-version = "0.7.9"
+version = "0.7.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"downcast 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "prolog_parser 0.7.9",
+ "prolog_parser 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
"checksum num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "cacfcab5eb48250ee7d0c7896b51a2c5eec99c1feea5f32025635f5ae4b00070"
"checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe"
"checksum ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58d25b6c0e47b20d05226d288ff434940296e7e2f8b877975da32f862152241f"
+"checksum prolog_parser 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "277adc8aef82e87336a642a9bbd480cac9550e5ec63c99465eed7cbc7c165808"
"checksum redox_syscall 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "ab105df655884ede59d45b7070c8a65002d921461ee813a024558ca16030eea0"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
#[macro_use] extern crate prolog_parser;
extern crate termion;
-use prolog::ast::*;
+use prolog::instructions::*;
mod prolog;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::fixtures::*;
use prolog::targets::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use std::ops::{Index, IndexMut};
use std::vec::Vec;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use std::cell::Cell;
use std::cmp::{min, max};
use std::rc::Rc;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::allocator::*;
use prolog::arithmetic::*;
use prolog::fixtures::*;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::debray_allocator::*;
use prolog::codegen::*;
use prolog::machine::*;
-use prolog::ast::*;
use prolog::and_stack::*;
+use prolog::instructions::*;
use std::ops::IndexMut;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::allocator::*;
use prolog::targets::*;
use prolog_parser::ast::*;
+use prolog::instructions::*;
use prolog::iterators::*;
-use prolog::ast::*;
use std::cell::Cell;
use std::collections::{BTreeMap, HashMap};
use std::collections::btree_map::{IntoIter, IterMut, Values};
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::machine::machine_state::*;
use std::collections::HashSet;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::machine::machine_state::*;
use prolog::num::*;
use prolog::heap_iter::*;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use std::collections::{HashMap, VecDeque};
use std::hash::Hash;
use std::rc::Rc;
IntIndex::Internal(_) => prelude_len - lst_offset + 1
}
}
-
pub fn add_indices(self, code: &mut Code, mut code_body: Code)
{
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::heap_print::*;
use prolog::machine::*;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use std::cell::Cell;
use std::collections::VecDeque;
use std::iter::*;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::machine::machine_state::*;
use prolog::num::bigint::BigInt;
use prolog_parser::ast::*;
use prolog_parser::tabled_rc::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::and_stack::*;
use prolog::copier::*;
use prolog::heap_print::*;
use prolog_parser::ast::*;
use prolog_parser::string_list::StringList;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::and_stack::*;
use prolog::copier::*;
use prolog::heap_iter::*;
return Ordering::Greater,
(HeapCellValue::Addr(Addr::Con(Constant::String(_))),
HeapCellValue::Addr(Addr::Con(Constant::Number(_)))) =>
- return Ordering::Greater,
+ return Ordering::Greater,
(HeapCellValue::Addr(Addr::Con(Constant::String(s1))),
HeapCellValue::Addr(Addr::Con(Constant::String(s2)))) =>
- return s1.cmp(&s2),
+ return if s1.is_expandable() {
+ if s2.is_expandable() {
+ s1.cmp(&s2)
+ } else {
+ Ordering::Greater
+ }
+ } else {
+ if s2.is_expandable() {
+ Ordering::Less
+ } else {
+ s1.cmp(&s2)
+ }
+ },
(HeapCellValue::Addr(Addr::Con(Constant::String(_))), _) =>
return Ordering::Less,
(HeapCellValue::Addr(Addr::Con(Constant::Atom(..))),
use prolog_parser::ast::*;
use prolog_parser::tabled_rc::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::compile::*;
use prolog::heap_print::*;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::machine::machine_errors::*;
use prolog::machine::machine_state::*;
use prolog::num::{ToPrimitive, Zero};
extern crate ordered_float;
extern crate prolog_parser;
-#[macro_use] pub mod ast;
+#[macro_use] pub mod instructions;
pub mod and_stack;
#[macro_use] pub mod macros;
#[macro_use] pub mod allocator;
-use prolog::ast::*;
+use prolog::instructions::*;
use std::ops::{Index, IndexMut};
use std::vec::Vec;
use prolog_parser::ast::*;
use prolog_parser::parser::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::iterators::*;
use prolog::machine::machine_state::*;
use prolog_parser::ast::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::iterators::*;
pub trait CompilationTarget<'a> {
use prolog_parser::parser::*;
use prolog_parser::tabled_rc::*;
-use prolog::ast::*;
+use prolog::instructions::*;
use prolog::iterators::*;
use prolog::machine::*;
use prolog::num::*;
use prolog_parser::ast::*;
-use prolog::ast::*;
use prolog::heap_print::*;
+use prolog::instructions::*;
use prolog::compile::*;
use prolog::machine::*;
assert_prolog_failure!(&mut wam, "?- partial_string(\"abc\", X), partial_string(\"ababc\", Y), Y = [a,b|Z],
X == Z.");
+ assert_prolog_success!(&mut wam, "?- partial_string(\"abc\", X), X @> \"abc\".");
+ assert_prolog_failure!(&mut wam, "?- partial_string(\"abc\", X), X \\=@= \"abc\".");
+ assert_prolog_failure!(&mut wam, "?- partial_string(\"abc\", X), X @< \"abc\".");
}