Mercurial > hg > xemacs-beta
comparison src/lread.c @ 5243:808131ba4a57
Print symbols with ratio-like names and the associated ratios distinctly.
src/ChangeLog addition:
2010-08-15 Aidan Kehoe <kehoea@parhasard.net>
* print.c (print_symbol):
Escape any symbols that look like ratios, in the same way we do
symbols that look like floats or integers. Prevents confusion in
the Lisp reader.
* lread.c (isratio_string): Make this available even on builds
without HAVE_RATIO, so we can print symbols that look like ratios
with the appropriate escapes.
* lisp.h:
Make isratio_string available even if HAVE_RATIO is not defined.
tests/ChangeLog addition:
2010-08-15 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
Test that symbols with names that look like ratios are printed
distinctly from the equivalent ratios.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 15 Aug 2010 13:29:10 +0100 |
parents | 5efbd1253905 |
children | 02d875ebd1ea |
comparison
equal
deleted
inserted
replaced
5242:f3eca926258e | 5243:808131ba4a57 |
---|---|
2874 || state == (LEAD_INT|E_CHAR|EXP_INT) | 2874 || state == (LEAD_INT|E_CHAR|EXP_INT) |
2875 || state == (LEAD_INT|DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT) | 2875 || state == (LEAD_INT|DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT) |
2876 || state == (DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT))); | 2876 || state == (DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT))); |
2877 } | 2877 } |
2878 | 2878 |
2879 #ifdef HAVE_RATIO | |
2880 int | 2879 int |
2881 isratio_string (const char *cp) | 2880 isratio_string (const char *cp) |
2882 { | 2881 { |
2883 /* Possible minus/plus sign */ | 2882 /* Possible minus/plus sign */ |
2884 if (*cp == '-' || *cp == '+') | 2883 if (*cp == '-' || *cp == '+') |
2905 } while (*cp >= '0' && *cp <= '9'); | 2904 } while (*cp >= '0' && *cp <= '9'); |
2906 | 2905 |
2907 return *cp == '\0' || *cp == ' ' || *cp =='\t' || *cp == '\n' || | 2906 return *cp == '\0' || *cp == ' ' || *cp =='\t' || *cp == '\n' || |
2908 *cp == '\r' || *cp == '\f'; | 2907 *cp == '\r' || *cp == '\f'; |
2909 } | 2908 } |
2910 #endif | 2909 |
2911 | 2910 |
2912 static void * | 2911 static void * |
2913 sequence_reader (Lisp_Object readcharfun, | 2912 sequence_reader (Lisp_Object readcharfun, |
2914 Ichar terminator, | 2913 Ichar terminator, |
2915 void *state, | 2914 void *state, |