comparison src/syntax.h @ 88390:ee2122ab4d5b

(SET_RAW_SYNTAX_ENTRY): Call CHAR_TABLE_SET. (SYNTAX_ENTRY_FOLLOW_PARENT): Macro deleted. (SET_RAW_SYNTAX_ENTRY_RANGE): New macro. (SYNTAX_ENTRY_INT): Call CHAR_TABLE_REF.
author Kenichi Handa <handa@m17n.org>
date Fri, 01 Mar 2002 01:48:16 +0000
parents b945bdff4f96
children 9302a313a37b
comparison
equal deleted inserted replaced
88389:39b2b971cdb3 88390:ee2122ab4d5b
55 Smax /* Upper bound on codes that are meaningful */ 55 Smax /* Upper bound on codes that are meaningful */
56 }; 56 };
57 57
58 /* Set the syntax entry VAL for char C in table TABLE. */ 58 /* Set the syntax entry VAL for char C in table TABLE. */
59 59
60 #define SET_RAW_SYNTAX_ENTRY(table, c, val) \ 60 #define SET_RAW_SYNTAX_ENTRY(table, c, val) \
61 ((c) < CHAR_TABLE_SINGLE_BYTE_SLOTS \ 61 CHAR_TABLE_SET ((table), make_number (c), (val))
62 ? (XCHAR_TABLE (table)->contents[(unsigned char) (c)] = (val)) \ 62
63 : Faset ((table), make_number (c), (val))) 63 /* Set the syntax entry VAL for char-range RANGE in table TABLE.
64 64 RANGE is a cons (FROM . TO) specifying the range of characters. */
65 /* Fetch the syntax entry for char C in syntax table TABLE. 65
66 This macro is called only when C is less than CHAR_TABLE_ORDINARY_SLOTS. 66 #define SET_RAW_SYNTAX_ENTRY_RANGE(table, range, val) \
67 Do inheritance. */ 67 Fset_char_table_range ((table), (range), (val))
68
69 #ifdef __GNUC__
70 #define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \
71 ({ Lisp_Object tbl = table; \
72 Lisp_Object temp = XCHAR_TABLE (tbl)->contents[(c)]; \
73 while (NILP (temp)) \
74 { \
75 tbl = XCHAR_TABLE (tbl)->parent; \
76 if (NILP (tbl)) \
77 break; \
78 temp = XCHAR_TABLE (tbl)->contents[(c)]; \
79 } \
80 temp; })
81 #else
82 extern Lisp_Object syntax_temp;
83 extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
84
85 #define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \
86 (syntax_temp = XCHAR_TABLE (table)->contents[(c)], \
87 (NILP (syntax_temp) \
88 ? syntax_parent_lookup (table, (c)) \
89 : syntax_temp))
90 #endif
91 68
92 /* SYNTAX_ENTRY fetches the information from the entry for character C 69 /* SYNTAX_ENTRY fetches the information from the entry for character C
93 in syntax table TABLE, or from globally kept data (gl_state). 70 in syntax table TABLE, or from globally kept data (gl_state).
94 Does inheritance. */ 71 Does inheritance. */
95 /* CURRENT_SYNTAX_TABLE gives the syntax table valid for current 72 /* CURRENT_SYNTAX_TABLE gives the syntax table valid for current
103 #else 80 #else
104 # define SYNTAX_ENTRY SYNTAX_ENTRY_INT 81 # define SYNTAX_ENTRY SYNTAX_ENTRY_INT
105 # define CURRENT_SYNTAX_TABLE current_buffer->syntax_table 82 # define CURRENT_SYNTAX_TABLE current_buffer->syntax_table
106 #endif 83 #endif
107 84
108 #define SYNTAX_ENTRY_INT(c) \ 85 #define SYNTAX_ENTRY_INT(c) \
109 ((c) < CHAR_TABLE_SINGLE_BYTE_SLOTS \ 86 CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, make_number (c))
110 ? SYNTAX_ENTRY_FOLLOW_PARENT (CURRENT_SYNTAX_TABLE, \
111 (unsigned char) (c)) \
112 : Faref (CURRENT_SYNTAX_TABLE, \
113 make_number (c)))
114 87
115 /* Extract the information from the entry for character C 88 /* Extract the information from the entry for character C
116 in the current syntax table. */ 89 in the current syntax table. */
117 90
118 #ifdef __GNUC__ 91 #ifdef __GNUC__