]> Repositorios git - scryer-prolog.git/commitdiff
quote dot when quoted(true) (#349)
authorMark Thom <[email protected]>
Wed, 15 Apr 2020 06:54:32 +0000 (00:54 -0600)
committerMark Thom <[email protected]>
Sat, 18 Apr 2020 20:16:40 +0000 (14:16 -0600)
Cargo.lock
src/prolog/heap_print.rs
src/prolog/toplevel.pl

index cd183d597ebec34b1c207f0f03f9cee57c131396..34a10e99ab9333ef403921e47069aeb12254c197 100644 (file)
@@ -478,6 +478,7 @@ dependencies = [
 [[package]]
 name = "prolog_parser"
 version = "0.8.52"
+source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lexical 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-rug-adapter 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -621,7 +622,7 @@ dependencies = [
  "nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-rug-adapter 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "ordered-float 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "prolog_parser 0.8.52",
+ "prolog_parser 0.8.52 (registry+https://github.com/rust-lang/crates.io-index)",
  "ref_thread_local 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rug 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustyline 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -851,6 +852,7 @@ dependencies = [
 "checksum proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)" = "fcfdefadc3d57ca21cf17990a28ef4c0f7c61383a28cb7604cf4a18e6ede1420"
 "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
 "checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435"
+"checksum prolog_parser 0.8.52 (registry+https://github.com/rust-lang/crates.io-index)" = "6d9baffc92f102756f07ef5a367409d4d78ddb5c32bc3bd6ee4584a27f79408d"
 "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
 "checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f"
 "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
index ed9b9859fe41c7d62e0f3b96c4d68907b4df104a..c9cd42a5edab10dfa8438e01f72c47d5d545e970 100644 (file)
@@ -442,7 +442,7 @@ fn non_quoted_token<Iter: Iterator<Item = char>>(mut iter: Iter) -> bool {
     if let Some(c) = iter.next() {
         if small_letter_char!(c) {
             iter.all(|c| alpha_numeric_char!(c))
-        } else if graphic_token_char!(c) {
+        } else if c != '.' && graphic_token_char!(c) {
             non_quoted_graphic_token(iter, c)
         } else if semicolon_char!(c) {
             iter.next().is_none()
@@ -1116,7 +1116,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
             let mut char_count = 0;
 
             for c in buf_iter {
-                self.push_char('.');
+                self.append_str("'.'");
                 self.push_char('(');
 
                 char_printer(self, c);
index 37afaf6f1e46d760da99120eb8e737d9f4cdf019..4da303cef587974bddc0d8a42c0ffc01f603f4b9 100644 (file)
     atom(Value),
     atom_chars(Value, ValueChars),
     '$list_last_item'(ValueChars, Char),
+    Char \== '.',
     '$graphic_token_char'(Char).
 
 '$write_eqs_and_read_input'(B, VarList) :-