summaryrefslogtreecommitdiff
path: root/src/lread.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-11-15 06:29:24 +0000
committerRichard M. Stallman <rms@gnu.org>1993-11-15 06:29:24 +0000
commit477690d76026d0141dc130f09d65d666284a4cc5 (patch)
tree6b9b2ecff188ef8a7b6ef84c1e50fb7763fe797d /src/lread.c
parent32408dab30c4489921d4862f9c8d48c84da14f9a (diff)
downloademacs-477690d76026d0141dc130f09d65d666284a4cc5.tar.gz
(read1): If token has a \, don't treat it as a number.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/src/lread.c b/src/lread.c
index 6d215e8473e..5dbc921f829 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1189,6 +1189,7 @@ read1 (readcharfun)
if (c <= 040) goto retry;
{
register char *p = read_buffer;
+ int quoted = 0;
{
register char *end = read_buffer + read_buffer_size;
@@ -1212,7 +1213,10 @@ read1 (readcharfun)
end = read_buffer + read_buffer_size;
}
if (c == '\\')
- c = READCHAR;
+ {
+ c = READCHAR;
+ quoted = 1;
+ }
*p++ = c;
c = READCHAR;
}
@@ -1229,35 +1233,36 @@ read1 (readcharfun)
UNREAD (c);
}
- /* Is it an integer? */
- {
- register char *p1;
- register Lisp_Object val;
- p1 = read_buffer;
- if (*p1 == '+' || *p1 == '-') p1++;
- if (p1 != p)
- {
- while (p1 != p && (c = *p1) >= '0' && c <= '9') p1++;
+ if (!quoted)
+ {
+ register char *p1;
+ register Lisp_Object val;
+ p1 = read_buffer;
+ if (*p1 == '+' || *p1 == '-') p1++;
+ /* Is it an integer? */
+ if (p1 != p)
+ {
+ while (p1 != p && (c = *p1) >= '0' && c <= '9') p1++;
#ifdef LISP_FLOAT_TYPE
- /* Integers can have trailing decimal points. */
- if (p1 > read_buffer && p1 < p && *p1 == '.') p1++;
+ /* Integers can have trailing decimal points. */
+ if (p1 > read_buffer && p1 < p && *p1 == '.') p1++;
#endif
- if (p1 == p)
- /* It is an integer. */
- {
+ if (p1 == p)
+ /* It is an integer. */
+ {
#ifdef LISP_FLOAT_TYPE
- if (p1[-1] == '.')
- p1[-1] = '\0';
+ if (p1[-1] == '.')
+ p1[-1] = '\0';
#endif
- XSET (val, Lisp_Int, atoi (read_buffer));
- return val;
- }
- }
+ XSET (val, Lisp_Int, atoi (read_buffer));
+ return val;
+ }
+ }
#ifdef LISP_FLOAT_TYPE
- if (isfloat_string (read_buffer))
- return make_float (atof (read_buffer));
+ if (isfloat_string (read_buffer))
+ return make_float (atof (read_buffer));
#endif
- }
+ }
return intern (read_buffer);
}