Mercurial > hg > xemacs-beta
comparison src/lread.c @ 1104:8b464283e891
[xemacs-hg @ 2002-11-12 18:58:13 by james]
Unconditionally compile the LISP_FLOAT_TYPE code. Remove all
!LISP_FLOAT_TYPE code and the LISP_FLOAT_TYPE identifier itself.
author | james |
---|---|
date | Tue, 12 Nov 2002 18:58:41 +0000 |
parents | 93e076dd7825 |
children | 37bdd24225ef |
comparison
equal
deleted
inserted
replaced
1103:80d9ab2e9855 | 1104:8b464283e891 |
---|---|
1718 *saw_a_backslash = 0; | 1718 *saw_a_backslash = 0; |
1719 | 1719 |
1720 while (c > 040 /* #### - comma should be here as should backquote */ | 1720 while (c > 040 /* #### - comma should be here as should backquote */ |
1721 && !(c == '\"' || c == '\'' || c == ';' | 1721 && !(c == '\"' || c == '\'' || c == ';' |
1722 || c == '(' || c == ')' | 1722 || c == '(' || c == ')' |
1723 #ifndef LISP_FLOAT_TYPE | |
1724 /* If we have floating-point support, then we need | |
1725 to allow <digits><dot><digits>. */ | |
1726 || c =='.' | |
1727 #endif /* not LISP_FLOAT_TYPE */ | |
1728 || c == '[' || c == ']' || c == '#' | 1723 || c == '[' || c == ']' || c == '#' |
1729 )) | 1724 )) |
1730 { | 1725 { |
1731 if (c == '\\') | 1726 if (c == '\\') |
1732 { | 1727 { |
1778 { | 1773 { |
1779 int c; | 1774 int c; |
1780 | 1775 |
1781 while (p1 != p && (c = *p1) >= '0' && c <= '9') | 1776 while (p1 != p && (c = *p1) >= '0' && c <= '9') |
1782 p1++; | 1777 p1++; |
1783 #ifdef LISP_FLOAT_TYPE | |
1784 /* Integers can have trailing decimal points. */ | 1778 /* Integers can have trailing decimal points. */ |
1785 if (p1 > read_ptr && p1 < p && *p1 == '.') | 1779 if (p1 > read_ptr && p1 < p && *p1 == '.') |
1786 p1++; | 1780 p1++; |
1787 #endif | |
1788 if (p1 == p) | 1781 if (p1 == p) |
1789 { | 1782 { |
1790 /* It is an integer. */ | 1783 /* It is an integer. */ |
1791 #ifdef LISP_FLOAT_TYPE | |
1792 if (p1[-1] == '.') | 1784 if (p1[-1] == '.') |
1793 p1[-1] = '\0'; | 1785 p1[-1] = '\0'; |
1794 #endif | |
1795 #if 0 | 1786 #if 0 |
1796 { | 1787 { |
1797 int number = 0; | 1788 int number = 0; |
1798 if (sizeof (int) == sizeof (EMACS_INT)) | 1789 if (sizeof (int) == sizeof (EMACS_INT)) |
1799 number = atoi (read_buffer); | 1790 number = atoi (read_buffer); |
1806 #else | 1797 #else |
1807 return parse_integer ((Ibyte *) read_ptr, len, 10); | 1798 return parse_integer ((Ibyte *) read_ptr, len, 10); |
1808 #endif | 1799 #endif |
1809 } | 1800 } |
1810 } | 1801 } |
1811 #ifdef LISP_FLOAT_TYPE | |
1812 if (isfloat_string (read_ptr)) | 1802 if (isfloat_string (read_ptr)) |
1813 return make_float (atof (read_ptr)); | 1803 return make_float (atof (read_ptr)); |
1814 #endif | |
1815 } | 1804 } |
1816 | 1805 |
1817 { | 1806 { |
1818 Lisp_Object sym; | 1807 Lisp_Object sym; |
1819 if (uninterned_symbol) | 1808 if (uninterned_symbol) |
2218 case ']': | 2207 case ']': |
2219 /* #### - huh? these don't do what they seem... */ | 2208 /* #### - huh? these don't do what they seem... */ |
2220 return noseeum_cons (Qunbound, make_char (c)); | 2209 return noseeum_cons (Qunbound, make_char (c)); |
2221 case '.': | 2210 case '.': |
2222 { | 2211 { |
2223 #ifdef LISP_FLOAT_TYPE | |
2224 /* If a period is followed by a number, then we should read it | 2212 /* If a period is followed by a number, then we should read it |
2225 as a floating point number. Otherwise, it denotes a dotted | 2213 as a floating point number. Otherwise, it denotes a dotted |
2226 pair. | 2214 pair. |
2227 */ | 2215 */ |
2228 c = readchar (readcharfun); | 2216 c = readchar (readcharfun); |
2236 at least once, assuring that we will not try to UNREAD | 2224 at least once, assuring that we will not try to UNREAD |
2237 two characters in a row. | 2225 two characters in a row. |
2238 (I think this doesn't matter anymore because there should | 2226 (I think this doesn't matter anymore because there should |
2239 be no more danger in unreading multiple characters) */ | 2227 be no more danger in unreading multiple characters) */ |
2240 return read_atom (readcharfun, '.', 0); | 2228 return read_atom (readcharfun, '.', 0); |
2241 | |
2242 #else /* ! LISP_FLOAT_TYPE */ | |
2243 return noseeum_cons (Qunbound, make_char ('.')); | |
2244 #endif /* ! LISP_FLOAT_TYPE */ | |
2245 } | 2229 } |
2246 | 2230 |
2247 case '#': | 2231 case '#': |
2248 { | 2232 { |
2249 c = readchar (readcharfun); | 2233 c = readchar (readcharfun); |
2564 } | 2548 } |
2565 } | 2549 } |
2566 | 2550 |
2567 | 2551 |
2568 | 2552 |
2569 #ifdef LISP_FLOAT_TYPE | |
2570 | |
2571 #define LEAD_INT 1 | 2553 #define LEAD_INT 1 |
2572 #define DOT_CHAR 2 | 2554 #define DOT_CHAR 2 |
2573 #define TRAIL_INT 4 | 2555 #define TRAIL_INT 4 |
2574 #define E_CHAR 8 | 2556 #define E_CHAR 8 |
2575 #define EXP_INT 16 | 2557 #define EXP_INT 16 |
2620 || state == (DOT_CHAR|TRAIL_INT) | 2602 || state == (DOT_CHAR|TRAIL_INT) |
2621 || state == (LEAD_INT|E_CHAR|EXP_INT) | 2603 || state == (LEAD_INT|E_CHAR|EXP_INT) |
2622 || state == (LEAD_INT|DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT) | 2604 || state == (LEAD_INT|DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT) |
2623 || state == (DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT))); | 2605 || state == (DOT_CHAR|TRAIL_INT|E_CHAR|EXP_INT))); |
2624 } | 2606 } |
2625 #endif /* LISP_FLOAT_TYPE */ | |
2626 | 2607 |
2627 static void * | 2608 static void * |
2628 sequence_reader (Lisp_Object readcharfun, | 2609 sequence_reader (Lisp_Object readcharfun, |
2629 Ichar terminator, | 2610 Ichar terminator, |
2630 void *state, | 2611 void *state, |