comparison src/syntax.h @ 89483:2f877ed80fa6

*** empty log message ***
author Kenichi Handa <handa@m17n.org>
date Mon, 08 Sep 2003 12:53:41 +0000
parents 375f2633d815 9a7268b7a742
children 51677cb10ced
comparison
equal deleted inserted replaced
88123:375f2633d815 89483:2f877ed80fa6
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), 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) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c))
109 ((c) < CHAR_TABLE_SINGLE_BYTE_SLOTS \
110 ? SYNTAX_ENTRY_FOLLOW_PARENT (CURRENT_SYNTAX_TABLE, \
111 (unsigned char) (c)) \
112 : Faref (CURRENT_SYNTAX_TABLE, \
113 make_number (c)))
114 86
115 /* Extract the information from the entry for character C 87 /* Extract the information from the entry for character C
116 in the current syntax table. */ 88 in the current syntax table. */
117 89
118 #ifdef __GNUC__ 90 #ifdef __GNUC__
135 temp = SYNTAX_ENTRY (c); \ 107 temp = SYNTAX_ENTRY (c); \
136 (CONSP (temp) \ 108 (CONSP (temp) \
137 ? XCDR (temp) \ 109 ? XCDR (temp) \
138 : Qnil); }) 110 : Qnil); })
139 #else 111 #else
112 extern Lisp_Object syntax_temp;
140 #define SYNTAX(c) \ 113 #define SYNTAX(c) \
141 (syntax_temp = SYNTAX_ENTRY ((c)), \ 114 (syntax_temp = SYNTAX_ENTRY ((c)), \
142 (CONSP (syntax_temp) \ 115 (CONSP (syntax_temp) \
143 ? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff) \ 116 ? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff) \
144 : Swhitespace)) 117 : Swhitespace))