quote dot when quoted(true) (#349)

This commit is contained in:
Mark Thom
2020-04-15 00:54:32 -06:00
parent 9ef185978f
commit af14832b6c
3 changed files with 6 additions and 3 deletions

4
Cargo.lock generated
View File

@@ -478,6 +478,7 @@ dependencies = [
[[package]] [[package]]
name = "prolog_parser" name = "prolog_parser"
version = "0.8.52" version = "0.8.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"lexical 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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)", "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)", "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)", "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)", "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)", "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)", "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-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 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 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 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 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" "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"

View File

@@ -442,7 +442,7 @@ fn non_quoted_token<Iter: Iterator<Item = char>>(mut iter: Iter) -> bool {
if let Some(c) = iter.next() { if let Some(c) = iter.next() {
if small_letter_char!(c) { if small_letter_char!(c) {
iter.all(|c| alpha_numeric_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) non_quoted_graphic_token(iter, c)
} else if semicolon_char!(c) { } else if semicolon_char!(c) {
iter.next().is_none() iter.next().is_none()
@@ -1116,7 +1116,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
let mut char_count = 0; let mut char_count = 0;
for c in buf_iter { for c in buf_iter {
self.push_char('.'); self.append_str("'.'");
self.push_char('('); self.push_char('(');
char_printer(self, c); char_printer(self, c);

View File

@@ -123,6 +123,7 @@
atom(Value), atom(Value),
atom_chars(Value, ValueChars), atom_chars(Value, ValueChars),
'$list_last_item'(ValueChars, Char), '$list_last_item'(ValueChars, Char),
Char \== '.',
'$graphic_token_char'(Char). '$graphic_token_char'(Char).
'$write_eqs_and_read_input'(B, VarList) :- '$write_eqs_and_read_input'(B, VarList) :-