diff options
| author | Jim Blandy | 1992-07-13 18:39:10 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-07-13 18:39:10 +0000 |
| commit | 109d300c73bb5b1ec84d37cceb9cc545bd6f2444 (patch) | |
| tree | 8ad8c66b6a5234ded15cbf1604a1b3f4c5a420c0 /src | |
| parent | f06cd13688b4271a5f3ee3e1ffac4710ed9d19db (diff) | |
| download | emacs-109d300c73bb5b1ec84d37cceb9cc545bd6f2444.tar.gz emacs-109d300c73bb5b1ec84d37cceb9cc545bd6f2444.zip | |
*** empty log message ***
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/lread.c b/src/lread.c index 630a39a4fb0..037d6f6acb2 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -821,7 +821,6 @@ read1 (readcharfun) | |||
| 821 | 821 | ||
| 822 | case ')': | 822 | case ')': |
| 823 | case ']': | 823 | case ']': |
| 824 | case '.': | ||
| 825 | { | 824 | { |
| 826 | register Lisp_Object val; | 825 | register Lisp_Object val; |
| 827 | XSET (val, Lisp_Internal, c); | 826 | XSET (val, Lisp_Internal, c); |
| @@ -906,6 +905,27 @@ read1 (readcharfun) | |||
| 906 | return make_string (read_buffer, p - read_buffer); | 905 | return make_string (read_buffer, p - read_buffer); |
| 907 | } | 906 | } |
| 908 | 907 | ||
| 908 | case '.': | ||
| 909 | { | ||
| 910 | #ifdef LISP_FLOAT_TYPE | ||
| 911 | /* If a period is followed by a number, then we should read it | ||
| 912 | as a floating point number. Otherwise, it denotes a dotted | ||
| 913 | pair. */ | ||
| 914 | int next_char = READCHAR; | ||
| 915 | UNREAD (next_char); | ||
| 916 | |||
| 917 | if (! isdigit (next_char)) | ||
| 918 | #endif | ||
| 919 | { | ||
| 920 | register Lisp_Object val; | ||
| 921 | XSET (val, Lisp_Internal, c); | ||
| 922 | return val; | ||
| 923 | } | ||
| 924 | |||
| 925 | /* Otherwise, we fall through! Note that the atom-reading loop | ||
| 926 | below will now loop at least once, assuring that we will not | ||
| 927 | try to UNREAD two characters in a row. */ | ||
| 928 | } | ||
| 909 | default: | 929 | default: |
| 910 | if (c <= 040) goto retry; | 930 | if (c <= 040) goto retry; |
| 911 | { | 931 | { |
| @@ -917,7 +937,9 @@ read1 (readcharfun) | |||
| 917 | while (c > 040 && | 937 | while (c > 040 && |
| 918 | !(c == '\"' || c == '\'' || c == ';' || c == '?' | 938 | !(c == '\"' || c == '\'' || c == ';' || c == '?' |
| 919 | || c == '(' || c == ')' | 939 | || c == '(' || c == ')' |
| 920 | #ifndef LISP_FLOAT_TYPE /* we need to see <number><dot><number> */ | 940 | #ifndef LISP_FLOAT_TYPE |
| 941 | /* If we have floating-point support, then we need | ||
| 942 | to allow <digits><dot><digits>. */ | ||
| 921 | || c =='.' | 943 | || c =='.' |
| 922 | #endif /* not LISP_FLOAT_TYPE */ | 944 | #endif /* not LISP_FLOAT_TYPE */ |
| 923 | || c == '[' || c == ']' || c == '#' | 945 | || c == '[' || c == ']' || c == '#' |