486
|
1 /* Declarations having to do with GNU Emacs syntax tables.
|
20708
|
2 Copyright (C) 1985, 93, 94, 97, 1998 Free Software Foundation, Inc.
|
486
|
3
|
|
4 This file is part of GNU Emacs.
|
|
5
|
|
6 GNU Emacs is free software; you can redistribute it and/or modify
|
|
7 it under the terms of the GNU General Public License as published by
|
12244
|
8 the Free Software Foundation; either version 2, or (at your option)
|
486
|
9 any later version.
|
|
10
|
|
11 GNU Emacs is distributed in the hope that it will be useful,
|
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 GNU General Public License for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with GNU Emacs; see the file COPYING. If not, write to
|
14186
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
486
|
20
|
|
21
|
|
22 extern Lisp_Object Qsyntax_table_p;
|
20349
|
23 extern void update_syntax_table P_ ((int, int, int, Lisp_Object));
|
486
|
24
|
|
25 /* The standard syntax table is stored where it will automatically
|
|
26 be used in all new buffers. */
|
|
27 #define Vstandard_syntax_table buffer_defaults.syntax_table
|
|
28
|
13143
|
29 /* A syntax table is a chartable whose elements are cons cells
|
|
30 (CODE+FLAGS . MATCHING-CHAR). MATCHING-CHAR can be nil if the char
|
|
31 is not a kind of parenthesis.
|
486
|
32
|
13143
|
33 The low 8 bits of CODE+FLAGS is a code, as follows: */
|
486
|
34
|
|
35 enum syntaxcode
|
|
36 {
|
|
37 Swhitespace, /* for a whitespace character */
|
|
38 Spunct, /* for random punctuation characters */
|
|
39 Sword, /* for a word constituent */
|
|
40 Ssymbol, /* symbol constituent but not word constituent */
|
|
41 Sopen, /* for a beginning delimiter */
|
|
42 Sclose, /* for an ending delimiter */
|
|
43 Squote, /* for a prefix character like Lisp ' */
|
|
44 Sstring, /* for a string-grouping character like Lisp " */
|
17465
|
45 Smath, /* for delimiters like $ in Tex. */
|
486
|
46 Sescape, /* for a character that begins a C-style escape */
|
|
47 Scharquote, /* for a character that quotes the following character */
|
|
48 Scomment, /* for a comment-starting character */
|
|
49 Sendcomment, /* for a comment-ending character */
|
5441
|
50 Sinherit, /* use the standard syntax table for this character */
|
17465
|
51 Scomment_fence, /* Starts/ends comment which is delimited on the
|
20487
|
52 other side by any char with the same syntaxcode. */
|
17465
|
53 Sstring_fence, /* Starts/ends string which is delimited on the
|
20487
|
54 other side by any char with the same syntaxcode. */
|
486
|
55 Smax /* Upper bound on codes that are meaningful */
|
|
56 };
|
|
57
|
17045
|
58 /* Set the syntax entry VAL for char C in table TABLE. */
|
13143
|
59
|
17127
|
60 #define SET_RAW_SYNTAX_ENTRY(table, c, val) \
|
17181
|
61 ((c) < CHAR_TABLE_SINGLE_BYTE_SLOTS \
|
17127
|
62 ? (XCHAR_TABLE (table)->contents[(unsigned char) (c)] = (val)) \
|
|
63 : Faset ((table), make_number (c), (val)))
|
486
|
64
|
17045
|
65 /* Fetch the syntax entry for char C in syntax table TABLE.
|
|
66 This macro is called only when C is less than CHAR_TABLE_ORDINARY_SLOTS.
|
|
67 Do inheritance. */
|
5441
|
68
|
|
69 #ifdef __GNUC__
|
17045
|
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 } \
|
13143
|
80 temp; })
|
17045
|
81 #else
|
|
82 extern Lisp_Object syntax_temp;
|
20349
|
83 extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
|
13143
|
84
|
17045
|
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
|
17465
|
92 /* SYNTAX_ENTRY fetches the information from the entry for character C
|
|
93 in syntax table TABLE, or from globally kept data (gl_state).
|
|
94 Does inheritance. */
|
|
95 /* CURRENT_SYNTAX_TABLE gives the syntax table valid for current
|
|
96 position, it is either the buffer's syntax table, or syntax table
|
|
97 found in text properties. */
|
17045
|
98
|
17465
|
99 #ifdef SYNTAX_ENTRY_VIA_PROPERTY
|
|
100 # define SYNTAX_ENTRY(c) \
|
|
101 (gl_state.use_global ? gl_state.global_code : SYNTAX_ENTRY_INT (c))
|
|
102 # define CURRENT_SYNTAX_TABLE gl_state.current_syntax_table
|
|
103 #else
|
|
104 # define SYNTAX_ENTRY SYNTAX_ENTRY_INT
|
|
105 # define CURRENT_SYNTAX_TABLE current_buffer->syntax_table
|
|
106 #endif
|
|
107
|
26870
|
108 #define SYNTAX_ENTRY_INT(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)))
|
17045
|
114
|
|
115 /* Extract the information from the entry for character C
|
|
116 in the current syntax table. */
|
|
117
|
|
118 #ifdef __GNUC__
|
13143
|
119 #define SYNTAX(c) \
|
|
120 ({ Lisp_Object temp; \
|
|
121 temp = SYNTAX_ENTRY (c); \
|
|
122 (CONSP (temp) \
|
25640
|
123 ? (enum syntaxcode) (XINT (XCAR (temp)) & 0xff) \
|
17045
|
124 : Swhitespace); })
|
13143
|
125
|
|
126 #define SYNTAX_WITH_FLAGS(c) \
|
|
127 ({ Lisp_Object temp; \
|
|
128 temp = SYNTAX_ENTRY (c); \
|
|
129 (CONSP (temp) \
|
25640
|
130 ? XINT (XCAR (temp)) \
|
17045
|
131 : (int) Swhitespace); })
|
13143
|
132
|
|
133 #define SYNTAX_MATCH(c) \
|
|
134 ({ Lisp_Object temp; \
|
|
135 temp = SYNTAX_ENTRY (c); \
|
|
136 (CONSP (temp) \
|
25640
|
137 ? XCDR (temp) \
|
17045
|
138 : Qnil); })
|
5441
|
139 #else
|
13143
|
140 #define SYNTAX(c) \
|
13318
94a4b6e9d310
(SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH): Fix the non-GCC definitions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
141 (syntax_temp = SYNTAX_ENTRY ((c)), \
|
13143
|
142 (CONSP (syntax_temp) \
|
25640
|
143 ? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff) \
|
17045
|
144 : Swhitespace))
|
13143
|
145
|
|
146 #define SYNTAX_WITH_FLAGS(c) \
|
13318
94a4b6e9d310
(SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH): Fix the non-GCC definitions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
147 (syntax_temp = SYNTAX_ENTRY ((c)), \
|
13143
|
148 (CONSP (syntax_temp) \
|
25640
|
149 ? XINT (XCAR (syntax_temp)) \
|
17045
|
150 : (int) Swhitespace))
|
13143
|
151
|
|
152 #define SYNTAX_MATCH(c) \
|
13318
94a4b6e9d310
(SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH): Fix the non-GCC definitions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
153 (syntax_temp = SYNTAX_ENTRY ((c)), \
|
13143
|
154 (CONSP (syntax_temp) \
|
25640
|
155 ? XCDR (syntax_temp) \
|
17045
|
156 : Qnil))
|
5441
|
157 #endif
|
486
|
158
|
25446
|
159 /* Then there are seven single-bit flags that have the following meanings:
|
486
|
160 1. This character is the first of a two-character comment-start sequence.
|
|
161 2. This character is the second of a two-character comment-start sequence.
|
|
162 3. This character is the first of a two-character comment-end sequence.
|
|
163 4. This character is the second of a two-character comment-end sequence.
|
|
164 5. This character is a prefix, for backward-prefix-chars.
|
25446
|
165 6. see below
|
|
166 7. This character is part of a nestable comment sequence.
|
1073
|
167 Note that any two-character sequence whose first character has flag 1
|
|
168 and whose second character has flag 2 will be interpreted as a comment start.
|
|
169
|
|
170 bit 6 is used to discriminate between two different comment styles.
|
|
171 Languages such as C++ allow two orthogonal syntax start/end pairs
|
|
172 and bit 6 is used to determine whether a comment-end or Scommentend
|
17465
|
173 ends style a or b. Comment start sequences can start style a or b.
|
1073
|
174 Style a is always the default.
|
|
175 */
|
486
|
176
|
21206
|
177 /* These macros extract a particular flag for a given character. */
|
|
178
|
13143
|
179 #define SYNTAX_COMSTART_FIRST(c) ((SYNTAX_WITH_FLAGS (c) >> 16) & 1)
|
5441
|
180
|
13143
|
181 #define SYNTAX_COMSTART_SECOND(c) ((SYNTAX_WITH_FLAGS (c) >> 17) & 1)
|
486
|
182
|
13143
|
183 #define SYNTAX_COMEND_FIRST(c) ((SYNTAX_WITH_FLAGS (c) >> 18) & 1)
|
486
|
184
|
13143
|
185 #define SYNTAX_COMEND_SECOND(c) ((SYNTAX_WITH_FLAGS (c) >> 19) & 1)
|
486
|
186
|
13143
|
187 #define SYNTAX_PREFIX(c) ((SYNTAX_WITH_FLAGS (c) >> 20) & 1)
|
486
|
188
|
13143
|
189 #define SYNTAX_COMMENT_STYLE(c) ((SYNTAX_WITH_FLAGS (c) >> 21) & 1)
|
1073
|
190
|
25446
|
191 #define SYNTAX_COMMENT_NESTED(c) ((SYNTAX_WITH_FLAGS (c) >> 22) & 1)
|
|
192
|
21206
|
193 /* These macros extract specific flags from an integer
|
|
194 that holds the syntax code and the flags. */
|
|
195
|
|
196 #define SYNTAX_FLAGS_COMSTART_FIRST(flags) (((flags) >> 16) & 1)
|
|
197
|
|
198 #define SYNTAX_FLAGS_COMSTART_SECOND(flags) (((flags) >> 17) & 1)
|
|
199
|
|
200 #define SYNTAX_FLAGS_COMEND_FIRST(flags) (((flags) >> 18) & 1)
|
|
201
|
|
202 #define SYNTAX_FLAGS_COMEND_SECOND(flags) (((flags) >> 19) & 1)
|
|
203
|
|
204 #define SYNTAX_FLAGS_PREFIX(flags) (((flags) >> 20) & 1)
|
|
205
|
|
206 #define SYNTAX_FLAGS_COMMENT_STYLE(flags) (((flags) >> 21) & 1)
|
|
207
|
25446
|
208 #define SYNTAX_FLAGS_COMMENT_NESTED(flags) (((flags) >> 22) & 1)
|
|
209
|
486
|
210 /* This array, indexed by a character, contains the syntax code which that
|
|
211 character signifies (as a char). For example,
|
17465
|
212 (enum syntaxcode) syntax_spec_code['w'] is Sword. */
|
486
|
213
|
|
214 extern unsigned char syntax_spec_code[0400];
|
|
215
|
17465
|
216 /* Indexed by syntax code, give the letter that describes it. */
|
|
217
|
|
218 extern char syntax_code_spec[16];
|
|
219
|
20649
|
220 /* Convert the byte offset BYTEPOS into a character position,
|
21015
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
221 for the object recorded in gl_state with SETUP_SYNTAX_TABLE_FOR_OBJECT.
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
222
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
223 The value is meant for use in the UPDATE_SYNTAX_TABLE... macros.
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
224 These macros do nothing when parse_sexp_lookup_properties is 0,
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
225 so we return 0 in that case, for speed. */
|
20649
|
226
|
|
227 #define SYNTAX_TABLE_BYTE_TO_CHAR(bytepos) \
|
21015
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
228 (! parse_sexp_lookup_properties \
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
229 ? 0 \
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
230 : STRINGP (gl_state.object) \
|
20649
|
231 ? string_byte_to_char (gl_state.object, (bytepos)) \
|
|
232 : BUFFERP (gl_state.object) \
|
21481
|
233 ? buf_bytepos_to_charpos (XBUFFER (gl_state.object), \
|
|
234 (bytepos) + BUF_BEGV_BYTE (XBUFFER (gl_state.object)) - 1) - BUF_BEGV (XBUFFER (gl_state.object)) + 1 \
|
20649
|
235 : NILP (gl_state.object) \
|
21481
|
236 ? BYTE_TO_CHAR ((bytepos) + BEGV_BYTE - 1) - BEGV + 1 \
|
20649
|
237 : (bytepos))
|
|
238
|
21481
|
239 /* Make syntax table state (gl_state) good for CHARPOS, assuming it is
|
|
240 currently good for a position before CHARPOS. */
|
17465
|
241
|
21481
|
242 #define UPDATE_SYNTAX_TABLE_FORWARD(charpos) \
|
21015
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
243 (parse_sexp_lookup_properties \
|
21481
|
244 && (charpos) >= gl_state.e_property \
|
|
245 ? (update_syntax_table ((charpos) + gl_state.offset, 1, 0, \
|
20649
|
246 gl_state.object), \
|
|
247 1) \
|
|
248 : 0)
|
17465
|
249
|
21481
|
250 /* Make syntax table state (gl_state) good for CHARPOS, assuming it is
|
|
251 currently good for a position after CHARPOS. */
|
18678
|
252
|
21481
|
253 #define UPDATE_SYNTAX_TABLE_BACKWARD(charpos) \
|
21015
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
254 (parse_sexp_lookup_properties \
|
39795
|
255 && (charpos) < gl_state.b_property \
|
21481
|
256 ? (update_syntax_table ((charpos) + gl_state.offset, -1, 0, \
|
20649
|
257 gl_state.object), \
|
|
258 1) \
|
|
259 : 0)
|
17465
|
260
|
21481
|
261 /* Make syntax table good for CHARPOS. */
|
18678
|
262
|
21481
|
263 #define UPDATE_SYNTAX_TABLE(charpos) \
|
21015
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
264 (parse_sexp_lookup_properties \
|
39795
|
265 && (charpos) < gl_state.b_property \
|
21481
|
266 ? (update_syntax_table ((charpos) + gl_state.offset, -1, 0, \
|
20649
|
267 gl_state.object), \
|
|
268 1) \
|
21015
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
269 : (parse_sexp_lookup_properties \
|
21481
|
270 && (charpos) >= gl_state.e_property \
|
|
271 ? (update_syntax_table ((charpos) + gl_state.offset, 1, 0,\
|
20649
|
272 gl_state.object), \
|
|
273 1) \
|
|
274 : 0))
|
17465
|
275
|
|
276 /* This macro should be called with FROM at the start of forward
|
|
277 search, or after the last position of the backward search. It
|
|
278 makes sure that the first char is picked up with correct table, so
|
|
279 one does not need to call UPDATE_SYNTAX_TABLE immediately after the
|
|
280 call.
|
|
281 Sign of COUNT gives the direction of the search.
|
|
282 */
|
|
283
|
20649
|
284 #define SETUP_SYNTAX_TABLE(FROM, COUNT) \
|
21015
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
285 if (1) \
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
286 { \
|
39795
|
287 gl_state.b_property = BEGV; \
|
21015
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
288 gl_state.e_property = ZV + 1; \
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
289 gl_state.object = Qnil; \
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
290 gl_state.use_global = 0; \
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
291 gl_state.offset = 0; \
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
292 gl_state.current_syntax_table = current_buffer->syntax_table; \
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
293 if (parse_sexp_lookup_properties) \
|
22438
|
294 if ((COUNT) > 0 || (FROM) > BEGV) \
|
|
295 update_syntax_table ((COUNT) > 0 ? (FROM) : (FROM) - 1, (COUNT),\
|
|
296 1, Qnil); \
|
21015
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
297 } \
|
9f8f791762a8
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
298 else
|
17465
|
299
|
|
300 /* Same as above, but in OBJECT. If OBJECT is nil, use current buffer.
|
18678
|
301 If it is t, ignore properties altogether.
|
|
302
|
|
303 This is meant for regex.c to use. For buffers, regex.c passes arguments
|
|
304 to the UPDATE_SYNTAX_TABLE macros which are relative to BEGV.
|
20544
|
305 So if it is a buffer, we set the offset field to BEGV. */
|
486
|
306
|
20649
|
307 #define SETUP_SYNTAX_TABLE_FOR_OBJECT(OBJECT, FROM, COUNT) \
|
20544
|
308 if (1) \
|
|
309 { \
|
20649
|
310 gl_state.object = (OBJECT); \
|
|
311 if (BUFFERP (gl_state.object)) \
|
|
312 { \
|
|
313 struct buffer *buf = XBUFFER (gl_state.object); \
|
39795
|
314 gl_state.b_property = 1; \
|
20957
|
315 gl_state.e_property = BUF_ZV (buf) - BUF_BEGV (buf) + 1; \
|
20649
|
316 gl_state.offset = BUF_BEGV (buf) - 1; \
|
|
317 } \
|
|
318 else if (NILP (gl_state.object)) \
|
20544
|
319 { \
|
39795
|
320 gl_state.b_property = 1; \
|
20957
|
321 gl_state.e_property = ZV - BEGV + 1; \
|
20544
|
322 gl_state.offset = BEGV - 1; \
|
|
323 } \
|
20649
|
324 else if (EQ (gl_state.object, Qt)) \
|
20544
|
325 { \
|
39795
|
326 gl_state.b_property = 0; \
|
20544
|
327 gl_state.e_property = 1500000000; \
|
|
328 gl_state.offset = 0; \
|
|
329 } \
|
|
330 else \
|
|
331 { \
|
39795
|
332 gl_state.b_property = 0; \
|
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
diff
changeset
|
333 gl_state.e_property = 1 + SCHARS (gl_state.object); \
|
20544
|
334 gl_state.offset = 0; \
|
|
335 } \
|
|
336 gl_state.use_global = 0; \
|
|
337 gl_state.current_syntax_table = current_buffer->syntax_table; \
|
|
338 if (parse_sexp_lookup_properties) \
|
21481
|
339 update_syntax_table (((FROM) + gl_state.offset \
|
20649
|
340 + (COUNT > 0 ? 0 : -1)), \
|
|
341 COUNT, 1, gl_state.object); \
|
20544
|
342 } \
|
|
343 else
|
17465
|
344
|
|
345 struct gl_state_s
|
|
346 {
|
20649
|
347 Lisp_Object object; /* The object we are scanning. */
|
17465
|
348 int start; /* Where to stop. */
|
|
349 int stop; /* Where to stop. */
|
|
350 int use_global; /* Whether to use global_code
|
|
351 or c_s_t. */
|
|
352 Lisp_Object global_code; /* Syntax code of current char. */
|
|
353 Lisp_Object current_syntax_table; /* Syntax table for current pos. */
|
|
354 Lisp_Object old_prop; /* Syntax-table prop at prev pos. */
|
39795
|
355 int b_property; /* First index where c_s_t is valid. */
|
17465
|
356 int e_property; /* First index where c_s_t is
|
|
357 not valid. */
|
|
358 INTERVAL forward_i; /* Where to start lookup on forward */
|
|
359 INTERVAL backward_i; /* or backward movement. The
|
|
360 data in c_s_t is valid
|
|
361 between these intervals,
|
|
362 and possibly at the
|
|
363 intervals too, depending
|
|
364 on: */
|
18678
|
365 /* Offset for positions specified to UPDATE_SYNTAX_TABLE. */
|
|
366 int offset;
|
17465
|
367 };
|
|
368
|
|
369 extern struct gl_state_s gl_state;
|
|
370 extern int parse_sexp_lookup_properties;
|
20349
|
371 extern INTERVAL interval_of P_ ((int, Lisp_Object));
|
|
372
|
|
373 extern int scan_words P_ ((int, int));
|