aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.h')
-rw-r--r--src/syntax.h43
1 files changed, 8 insertions, 35 deletions
diff --git a/src/syntax.h b/src/syntax.h
index b3980c3e851..5a5a8a96da3 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -58,37 +58,14 @@ enum syntaxcode
58 58
59/* Set the syntax entry VAL for char C in table TABLE. */ 59/* Set the syntax entry VAL for char C in table TABLE. */
60 60
61#define SET_RAW_SYNTAX_ENTRY(table, c, val) \ 61#define SET_RAW_SYNTAX_ENTRY(table, c, val) \
62 ((((c) & 0xFF) == (c)) \ 62 CHAR_TABLE_SET ((table), c, (val))
63 ? (XCHAR_TABLE (table)->contents[(unsigned char) (c)] = (val)) \
64 : Faset ((table), make_number (c), (val)))
65 63
66/* Fetch the syntax entry for char C in syntax table TABLE. 64/* Set the syntax entry VAL for char-range RANGE in table TABLE.
67 This macro is called only when C is less than CHAR_TABLE_ORDINARY_SLOTS. 65 RANGE is a cons (FROM . TO) specifying the range of characters. */
68 Do inheritance. */
69 66
70#ifdef __GNUC__ 67#define SET_RAW_SYNTAX_ENTRY_RANGE(table, range, val) \
71#define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \ 68 Fset_char_table_range ((table), (range), (val))
72 ({ Lisp_Object _syntax_tbl = (table); \
73 Lisp_Object _syntax_temp = XCHAR_TABLE (_syntax_tbl)->contents[(c)]; \
74 while (NILP (_syntax_temp)) \
75 { \
76 _syntax_tbl = XCHAR_TABLE (_syntax_tbl)->parent; \
77 if (NILP (_syntax_tbl)) \
78 break; \
79 _syntax_temp = XCHAR_TABLE (_syntax_tbl)->contents[(c)]; \
80 } \
81 _syntax_temp; })
82#else
83extern Lisp_Object syntax_temp;
84extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
85
86#define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \
87 (syntax_temp = XCHAR_TABLE (table)->contents[(c)], \
88 (NILP (syntax_temp) \
89 ? syntax_parent_lookup (table, (c)) \
90 : syntax_temp))
91#endif
92 69
93/* SYNTAX_ENTRY fetches the information from the entry for character C 70/* SYNTAX_ENTRY fetches the information from the entry for character C
94 in syntax table TABLE, or from globally kept data (gl_state). 71 in syntax table TABLE, or from globally kept data (gl_state).
@@ -106,12 +83,7 @@ extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
106# define CURRENT_SYNTAX_TABLE current_buffer->syntax_table 83# define CURRENT_SYNTAX_TABLE current_buffer->syntax_table
107#endif 84#endif
108 85
109#define SYNTAX_ENTRY_INT(c) \ 86#define SYNTAX_ENTRY_INT(c) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c))
110 ((((c) & 0xFF) == (c)) \
111 ? SYNTAX_ENTRY_FOLLOW_PARENT (CURRENT_SYNTAX_TABLE, \
112 (unsigned char) (c)) \
113 : Faref (CURRENT_SYNTAX_TABLE, \
114 make_number (c)))
115 87
116/* Extract the information from the entry for character C 88/* Extract the information from the entry for character C
117 in the current syntax table. */ 89 in the current syntax table. */
@@ -138,6 +110,7 @@ extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
138 ? XCDR (_syntax_temp) \ 110 ? XCDR (_syntax_temp) \
139 : Qnil); }) 111 : Qnil); })
140#else 112#else
113extern Lisp_Object syntax_temp;
141#define SYNTAX(c) \ 114#define SYNTAX(c) \
142 (syntax_temp = SYNTAX_ENTRY ((c)), \ 115 (syntax_temp = SYNTAX_ENTRY ((c)), \
143 (CONSP (syntax_temp) \ 116 (CONSP (syntax_temp) \