patch by UN: Avoid writing quoted for bar. Conforms to 6.3.4.3 of ISO/IEC 13211-1:1995/Cor 2:2012

This commit is contained in:
Vítor Santos Costa 2012-03-22 22:15:07 +00:00
parent 65e61cfefd
commit 573c11e8b2

View File

@ -1014,13 +1014,15 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
wrputc(')', wglb->stream); wrputc(')', wglb->stream);
lastw = separator; lastw = separator;
} }
/* avoid quoting commas */ /* avoid quoting commas and bars */
if (strcmp(RepAtom(atom)->StrOfAE,",")) if (!strcmp(RepAtom(atom)->StrOfAE,",")) {
putAtom(atom, wglb->Quote_illegal, wglb);
else {
wrputc(',', wglb->stream); wrputc(',', wglb->stream);
lastw = separator; lastw = separator;
} } else if (!strcmp(RepAtom(atom)->StrOfAE,"|")) {
wrputc('|', wglb->stream);
lastw = separator;
} else
putAtom(atom, wglb->Quote_illegal, wglb);
if (bracket_right) { if (bracket_right) {
wrputc('(', wglb->stream); wrputc('(', wglb->stream);
lastw = separator; lastw = separator;