comparison src/lread.c @ 831:5d09ddada9ae

[xemacs-hg @ 2002-05-09 07:15:20 by ben] fix two bugs noted by Steve doprnt.c: Use make_int() not make_char() when error about bad charval, or abort will occur. extents.c: Loop over children, not ourself -- avoid infinite loop. lisp-disunion.h, lisp-union.h: Rename make_char() to make_char_1 for error-checking purposes. lread.c: Syntax error if escape is outside of ISO-8859-1 range. Remove hopelessly broken (and unworkable) FSF_KEYS code. mule-coding.c, search.c: Spacing changes. text.h: New make_char() -- verify that the char value is legal.
author ben
date Thu, 09 May 2002 07:16:38 +0000
parents 6728e641994e
children 047d37eb70d7
comparison
equal deleted inserted replaced
830:20baef34a0b0 831:5d09ddada9ae
1671 0-255. Under Mule it is much worse -- ?\H-a with FSF_KEYS 1671 0-255. Under Mule it is much worse -- ?\H-a with FSF_KEYS
1672 produces an illegal character, and moves us to crash-land. 1672 produces an illegal character, and moves us to crash-land.
1673 1673
1674 For these reasons, FSF_KEYS hack is useless and without hope 1674 For these reasons, FSF_KEYS hack is useless and without hope
1675 of ever working under XEmacs 20. */ 1675 of ever working under XEmacs 20. */
1676 #undef FSF_KEYS
1677
1678 #ifdef FSF_KEYS 1676 #ifdef FSF_KEYS
1679 #define alt_modifier (0x040000) 1677 /* Deleted */
1680 #define super_modifier (0x080000) 1678 #endif
1681 #define hyper_modifier (0x100000)
1682 #define shift_modifier (0x200000)
1683 /* fsf uses a different modifiers for meta and control. Possibly
1684 byte_compiled code will still work fsfmacs, though... --Stig
1685
1686 #define ctl_modifier (0x400000)
1687 #define meta_modifier (0x800000)
1688 */
1689 #define FSF_LOSSAGE(mask) \
1690 if (fail_on_bucky_bit_character_escapes || \
1691 ((c = readchar (readcharfun)) != '-')) \
1692 syntax_error ("Invalid escape character syntax", Qunbound); \
1693 c = readchar (readcharfun); \
1694 if (c < 0) \
1695 signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun)); \
1696 if (c == '\\') \
1697 c = read_escape (readcharfun); \
1698 return c | mask
1699
1700 case 'S': FSF_LOSSAGE (shift_modifier);
1701 case 'H': FSF_LOSSAGE (hyper_modifier);
1702 case 'A': FSF_LOSSAGE (alt_modifier);
1703 case 's': FSF_LOSSAGE (super_modifier);
1704 #undef alt_modifier
1705 #undef super_modifier
1706 #undef hyper_modifier
1707 #undef shift_modifier
1708 #undef FSF_LOSSAGE
1709
1710 #endif /* FSF_KEYS */
1711 1679
1712 case 'C': 1680 case 'C':
1713 c = readchar (readcharfun); 1681 c = readchar (readcharfun);
1714 if (c < 0) 1682 if (c < 0)
1715 signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun)); 1683 signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun));
1748 { 1716 {
1749 unreadchar (readcharfun, c); 1717 unreadchar (readcharfun, c);
1750 break; 1718 break;
1751 } 1719 }
1752 } 1720 }
1721 if (i >= 0400)
1722 syntax_error ("Attempt to create non-ASCII/ISO-8859-1 character",
1723 make_int (i));
1753 return i; 1724 return i;
1754 } 1725 }
1755 1726
1756 case 'x': 1727 case 'x':
1757 /* A hex escape, as in ANSI C, except that we only allow latin-1 1728 /* A hex escape, as in ANSI C, except that we only allow latin-1