correct get_single_quoted_item, re: #48
This commit is contained in:
@@ -279,6 +279,7 @@ impl<'a, Formatter: HCValueFormatter, Outputter: HCValueOutputter>
|
|||||||
|
|
||||||
fn print_atom(&mut self, atom: &ClauseName) {
|
fn print_atom(&mut self, atom: &ClauseName) {
|
||||||
match atom.as_str() {
|
match atom.as_str() {
|
||||||
|
"" => self.outputter.append("''"),
|
||||||
";" | "!" => self.outputter.append(atom.as_str()),
|
";" | "!" => self.outputter.append(atom.as_str()),
|
||||||
s => if s.chars().all(non_quoted_token) {
|
s => if s.chars().all(non_quoted_token) {
|
||||||
self.outputter.append(atom.as_str());
|
self.outputter.append(atom.as_str());
|
||||||
@@ -301,7 +302,7 @@ impl<'a, Formatter: HCValueFormatter, Outputter: HCValueOutputter>
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn print_constant(&mut self, c: Constant) {
|
fn print_constant(&mut self, c: Constant) {
|
||||||
match c {
|
match c {
|
||||||
Constant::Atom(ref atom) =>
|
Constant::Atom(ref atom) =>
|
||||||
self.print_atom(atom),
|
self.print_atom(atom),
|
||||||
Constant::Char(c) if c == '\n' =>
|
Constant::Char(c) if c == '\n' =>
|
||||||
@@ -406,7 +407,7 @@ impl<'a, Formatter: HCValueFormatter, Outputter: HCValueOutputter>
|
|||||||
if let Some(loc_data) = self.state_stack.pop() {
|
if let Some(loc_data) = self.state_stack.pop() {
|
||||||
match loc_data {
|
match loc_data {
|
||||||
TokenOrRedirect::Atom(atom) =>
|
TokenOrRedirect::Atom(atom) =>
|
||||||
self.outputter.append(atom.as_str()),
|
self.print_atom(&atom),
|
||||||
TokenOrRedirect::NumberedVar(num_var) =>
|
TokenOrRedirect::NumberedVar(num_var) =>
|
||||||
self.outputter.append(num_var.as_str()),
|
self.outputter.append(num_var.as_str()),
|
||||||
TokenOrRedirect::Redirect =>
|
TokenOrRedirect::Redirect =>
|
||||||
|
|||||||
Submodule src/prolog/parser updated: 0df920d5a8...2258588947
Reference in New Issue
Block a user