Mercurial > emacs
diff src/lread.c @ 762:852a2f5838da
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Mon, 13 Jul 1992 18:39:10 +0000 |
parents | a8d94735277e |
children | 465cf9f9153b |
line wrap: on
line diff
--- a/src/lread.c Mon Jul 13 18:33:54 1992 +0000 +++ b/src/lread.c Mon Jul 13 18:39:10 1992 +0000 @@ -821,7 +821,6 @@ case ')': case ']': - case '.': { register Lisp_Object val; XSET (val, Lisp_Internal, c); @@ -906,6 +905,27 @@ return make_string (read_buffer, p - read_buffer); } + case '.': + { +#ifdef LISP_FLOAT_TYPE + /* If a period is followed by a number, then we should read it + as a floating point number. Otherwise, it denotes a dotted + pair. */ + int next_char = READCHAR; + UNREAD (next_char); + + if (! isdigit (next_char)) +#endif + { + register Lisp_Object val; + XSET (val, Lisp_Internal, c); + return val; + } + + /* Otherwise, we fall through! Note that the atom-reading loop + below will now loop at least once, assuring that we will not + try to UNREAD two characters in a row. */ + } default: if (c <= 040) goto retry; { @@ -917,7 +937,9 @@ while (c > 040 && !(c == '\"' || c == '\'' || c == ';' || c == '?' || c == '(' || c == ')' -#ifndef LISP_FLOAT_TYPE /* we need to see <number><dot><number> */ +#ifndef LISP_FLOAT_TYPE + /* If we have floating-point support, then we need + to allow <digits><dot><digits>. */ || c =='.' #endif /* not LISP_FLOAT_TYPE */ || c == '[' || c == ']' || c == '#'