-#define UPDATE_SYNTAX_TABLE(charpos) \
- (parse_sexp_lookup_properties \
- && (charpos) < gl_state.b_property \
- ? (update_syntax_table ((charpos) + gl_state.offset, -1, 0, \
- gl_state.object), \
- 1) \
- : (parse_sexp_lookup_properties \
- && (charpos) >= gl_state.e_property \
- ? (update_syntax_table ((charpos) + gl_state.offset, 1, 0,\
- gl_state.object), \
- 1) \
- : 0))
-
-/* This macro sets up the buffer-global syntax table. */
-#define SETUP_BUFFER_SYNTAX_TABLE() \
-do \
- { \
- gl_state.use_global = 0; \
- gl_state.current_syntax_table = BVAR (current_buffer, syntax_table);\
- } while (0)
-
-/* This macro should be called with FROM at the start of forward
- search, or after the last position of the backward search. It
- makes sure that the first char is picked up with correct table, so
- one does not need to call UPDATE_SYNTAX_TABLE immediately after the
- call.
- Sign of COUNT gives the direction of the search.
- */
-
-#define SETUP_SYNTAX_TABLE(FROM, COUNT) \
-do \
- { \
- SETUP_BUFFER_SYNTAX_TABLE (); \
- gl_state.b_property = BEGV; \
- gl_state.e_property = ZV + 1; \
- gl_state.object = Qnil; \
- gl_state.offset = 0; \
- if (parse_sexp_lookup_properties) \
- if ((COUNT) > 0 || (FROM) > BEGV) \
- update_syntax_table ((COUNT) > 0 ? (FROM) : (FROM) - 1, (COUNT),\
- 1, Qnil); \
- } \
-while (0)
-
-/* Same as above, but in OBJECT. If OBJECT is nil, use current buffer.
- If it is t (which is only used in fast_c_string_match_ignore_case),
- ignore properties altogether.
-
- This is meant for regex.c to use. For buffers, regex.c passes arguments
- to the UPDATE_SYNTAX_TABLE macros which are relative to BEGV.
- So if it is a buffer, we set the offset field to BEGV. */
-
-#define SETUP_SYNTAX_TABLE_FOR_OBJECT(OBJECT, FROM, COUNT) \
-do \
- { \
- SETUP_BUFFER_SYNTAX_TABLE (); \
- gl_state.object = (OBJECT); \
- if (BUFFERP (gl_state.object)) \
- { \
- struct buffer *buf = XBUFFER (gl_state.object); \
- gl_state.b_property = 1; \
- gl_state.e_property = BUF_ZV (buf) - BUF_BEGV (buf) + 1; \
- gl_state.offset = BUF_BEGV (buf) - 1; \
- } \
- else if (NILP (gl_state.object)) \
- { \
- gl_state.b_property = 1; \
- gl_state.e_property = ZV - BEGV + 1; \
- gl_state.offset = BEGV - 1; \
- } \
- else if (EQ (gl_state.object, Qt)) \
- { \
- gl_state.b_property = 0; \
- gl_state.e_property = MOST_POSITIVE_FIXNUM; \
- gl_state.offset = 0; \
- } \
- else \
- { \
- gl_state.b_property = 0; \
- gl_state.e_property = 1 + SCHARS (gl_state.object); \
- gl_state.offset = 0; \
- } \
- if (parse_sexp_lookup_properties) \
- update_syntax_table (((FROM) + gl_state.offset \
- + (COUNT > 0 ? 0 : -1)), \
- COUNT, 1, gl_state.object); \
- } \
-while (0)