comparison src/syntax.h @ 20544:a884f0426ab9

(SETUP_SYNTAX_TABLE_FOR_OBJECT): Call bytepos_to_charpos. Wrap in if (1) ... else.
author Richard M. Stallman <rms@gnu.org>
date Thu, 01 Jan 1998 02:46:10 +0000
parents c9224a343630
children 388cedeebb88
comparison
equal deleted inserted replaced
20543:4dbda4b7c66f 20544:a884f0426ab9
237 /* Same as above, but in OBJECT. If OBJECT is nil, use current buffer. 237 /* Same as above, but in OBJECT. If OBJECT is nil, use current buffer.
238 If it is t, ignore properties altogether. 238 If it is t, ignore properties altogether.
239 239
240 This is meant for regex.c to use. For buffers, regex.c passes arguments 240 This is meant for regex.c to use. For buffers, regex.c passes arguments
241 to the UPDATE_SYNTAX_TABLE macros which are relative to BEGV. 241 to the UPDATE_SYNTAX_TABLE macros which are relative to BEGV.
242 So if it is a buffer,a we set the offset field to BEGV. */ 242 So if it is a buffer, we set the offset field to BEGV. */
243 243
244 #define SETUP_SYNTAX_TABLE_FOR_OBJECT(object, from, count) \ 244 #define SETUP_SYNTAX_TABLE_FOR_OBJECT(object, from, count) \
245 if (BUFFERP (object) || NILP (object)) \ 245 if (1) \
246 { \ 246 { \
247 gl_state.b_property = BEGV - 1; \ 247 if (BUFFERP (object) || NILP (object)) \
248 gl_state.e_property = ZV; \ 248 { \
249 gl_state.offset = BEGV - 1; \ 249 gl_state.b_property = BEGV - 1; \
250 } \ 250 gl_state.e_property = ZV; \
251 else if (EQ (object, Qt)) \ 251 gl_state.offset = BEGV - 1; \
252 { \ 252 } \
253 gl_state.b_property = - 1; \ 253 else if (EQ (object, Qt)) \
254 gl_state.e_property = 1500000000; \ 254 { \
255 gl_state.offset = 0; \ 255 gl_state.b_property = - 1; \
256 } \ 256 gl_state.e_property = 1500000000; \
257 else \ 257 gl_state.offset = 0; \
258 { \ 258 } \
259 gl_state.b_property = -1; \ 259 else \
260 gl_state.e_property = 1 + XSTRING (object)->size; \ 260 { \
261 gl_state.offset = 0; \ 261 gl_state.b_property = -1; \
262 } \ 262 gl_state.e_property = 1 + XSTRING (object)->size; \
263 gl_state.use_global = 0; \ 263 gl_state.offset = 0; \
264 gl_state.current_syntax_table = current_buffer->syntax_table; \ 264 } \
265 if (parse_sexp_lookup_properties) \ 265 gl_state.use_global = 0; \
266 update_syntax_table (count > 0 ? (from) : (from) - 1, count, 1, object); 266 gl_state.current_syntax_table = current_buffer->syntax_table; \
267 if (parse_sexp_lookup_properties) \
268 update_syntax_table ((bytepos_to_charpos (from) \
269 + (count > 0 ? 0 : -1)), \
270 count, 1, object); \
271 } \
272 else
267 273
268 struct gl_state_s 274 struct gl_state_s
269 { 275 {
270 int start; /* Where to stop. */ 276 int start; /* Where to stop. */
271 int stop; /* Where to stop. */ 277 int stop; /* Where to stop. */