aboutsummaryrefslogtreecommitdiff
path: root/gdb/m2-exp.y
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1992-11-23 19:57:29 +0000
committerFred Fish <fnf@specifix.com>1992-11-23 19:57:29 +0000
commit5707ea9fad0ff4b51cc2c913af218c0a0b8278e9 (patch)
tree56bbdf02b7bfe05c993493734ff173af6175a466 /gdb/m2-exp.y
parentf53f0a036d1a9597223ee95a47ecf7a2a019f497 (diff)
downloadgdb-5707ea9fad0ff4b51cc2c913af218c0a0b8278e9.zip
gdb-5707ea9fad0ff4b51cc2c913af218c0a0b8278e9.tar.gz
gdb-5707ea9fad0ff4b51cc2c913af218c0a0b8278e9.tar.bz2
* language.h (PRINT_LITERAL_FORM): New macro that takes character
and decides if it should be printed in literal form or some other form, based on it's ASCII value and setting of sevenbit_strings. * {c-exp.y, m2-exp.y} (emit_char): Use new PRINT_LITERAL_FORM macro, change indentation style. **** start-sanitize-chill **** * ch-exp.y (chill_printchar): Use new PRINT_LITERAL_FORM macro. * ch-exp.y (chill_printstr): First cut at real function instead of error stub. **** end-sanitize-chill ****
Diffstat (limited to 'gdb/m2-exp.y')
-rw-r--r--gdb/m2-exp.y75
1 files changed, 38 insertions, 37 deletions
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index 85488cf..6edc059 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -1192,43 +1192,44 @@ emit_char (c, stream, quoter)
c &= 0xFF; /* Avoid sign bit follies */
- if ( c < 0x20 || /* Low control chars */
- (c >= 0x7F && c < 0xA0) || /* DEL, High controls */
- (sevenbit_strings && c >= 0x80)) { /* high order bit set */
- switch (c)
- {
- case '\n':
- fputs_filtered ("\\n", stream);
- break;
- case '\b':
- fputs_filtered ("\\b", stream);
- break;
- case '\t':
- fputs_filtered ("\\t", stream);
- break;
- case '\f':
- fputs_filtered ("\\f", stream);
- break;
- case '\r':
- fputs_filtered ("\\r", stream);
- break;
- case '\033':
- fputs_filtered ("\\e", stream);
- break;
- case '\007':
- fputs_filtered ("\\a", stream);
- break;
- default:
- fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
- break;
- }
- } else {
- if (c == '\\' || c == quoter)
- {
- fputs_filtered ("\\", stream);
- }
- fprintf_filtered (stream, "%c", c);
- }
+ if (PRINT_LITERAL_FORM (c))
+ {
+ if (c == '\\' || c == quoter)
+ {
+ fputs_filtered ("\\", stream);
+ }
+ fprintf_filtered (stream, "%c", c);
+ }
+ else
+ {
+ switch (c)
+ {
+ case '\n':
+ fputs_filtered ("\\n", stream);
+ break;
+ case '\b':
+ fputs_filtered ("\\b", stream);
+ break;
+ case '\t':
+ fputs_filtered ("\\t", stream);
+ break;
+ case '\f':
+ fputs_filtered ("\\f", stream);
+ break;
+ case '\r':
+ fputs_filtered ("\\r", stream);
+ break;
+ case '\033':
+ fputs_filtered ("\\e", stream);
+ break;
+ case '\007':
+ fputs_filtered ("\\a", stream);
+ break;
+ default:
+ fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
+ break;
+ }
+ }
}
/* FIXME: This is a copy of the same function from c-exp.y. It should