aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.h
diff options
context:
space:
mode:
authorKenichi Handa2002-03-01 01:48:16 +0000
committerKenichi Handa2002-03-01 01:48:16 +0000
commitf4926ee83540d77f35cc9a9251bc75025caea237 (patch)
tree9d32ad9440dcfdc3140e5e2f725d05d977181ba7 /src/syntax.h
parent5c7b02aba7f9668ed27f746265e7b0e152abaa1b (diff)
downloademacs-f4926ee83540d77f35cc9a9251bc75025caea237.tar.gz
emacs-f4926ee83540d77f35cc9a9251bc75025caea237.zip
(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.
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 41f6662ddeb..37fe06808c0 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -57,37 +57,14 @@ enum syntaxcode
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)) \
63 : Faset ((table), make_number (c), (val)))
64 62
65/* Fetch the syntax entry for char C in syntax table TABLE. 63/* Set the syntax entry VAL for char-range RANGE in table TABLE.
66 This macro is called only when C is less than CHAR_TABLE_ORDINARY_SLOTS. 64 RANGE is a cons (FROM . TO) specifying the range of characters. */
67 Do inheritance. */
68 65
69#ifdef __GNUC__ 66#define SET_RAW_SYNTAX_ENTRY_RANGE(table, range, val) \
70#define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \ 67 Fset_char_table_range ((table), (range), (val))
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
82extern Lisp_Object syntax_temp;
83extern 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).
@@ -105,12 +82,8 @@ extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, 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. */