/* Declarations having to do with XEmacs syntax tables.
Copyright (C) 1985, 1992, 1993 Free Software Foundation, Inc.
- Copyright (C) 2001 MORIOKA Tomohiko
This file is part of XEmacs.
now an abstract type, where we control all access.
*/
-/* The standard syntax table is stored where it will automatically
- be used in all new buffers. */
-extern Lisp_Object Vstandard_syntax_table;
-
enum syntaxcode
{
Swhitespace, /* whitespace character */
/* Return the syntax code for a particular character and mirror table. */
-#ifdef UTF2000
-INLINE_HEADER int SYNTAX_CODE_UNSAFE (Lisp_Char_Table *table, Emchar c);
-INLINE_HEADER int
-SYNTAX_CODE_UNSAFE (Lisp_Char_Table *table, Emchar c)
-{
- int code = CHAR_TABLE_VALUE_UNSAFE (table, c);
- int ret = Spunct;
-
- if (CONSP (code))
- code = XCAR (code);
- ret = XINT (code);
-
- if (ret == Sinherit)
- {
- code = CHAR_TABLE_VALUE_UNSAFE (XCHAR_TABLE
- (Vstandard_syntax_table), c);
- if (CONSP (code))
- code = XCAR (code);
- return XINT (code);
- }
- else
- return ret;
-}
-#else
#define SYNTAX_CODE_UNSAFE(table, c) \
- XINT (CHAR_TABLE_VALUE_UNSAFE (table, c))
-#endif
+ ((enum syntaxcode) XINT (CHAR_TABLE_VALUE_UNSAFE (table, c)))
-INLINE_HEADER int SYNTAX_CODE (Lisp_Char_Table *table, Emchar c);
-INLINE_HEADER int
+INLINE_HEADER enum syntaxcode SYNTAX_CODE (Lisp_Char_Table *table, Emchar c);
+INLINE_HEADER enum syntaxcode
SYNTAX_CODE (Lisp_Char_Table *table, Emchar c)
{
return SYNTAX_CODE_UNSAFE (table, c);
EXFUN (Fchar_syntax, 2);
EXFUN (Fforward_word, 2);
+/* The standard syntax table is stored where it will automatically
+ be used in all new buffers. */
+extern Lisp_Object Vstandard_syntax_table;
+
/* This array, indexed by a character, contains the syntax code which
that character signifies (as a char).
For example, (enum syntaxcode) syntax_spec_code['w'] is Sword. */
/* Target text (string or buffer), used for syntax-table properties. */
extern Lisp_Object regex_match_object;
-#ifndef UTF2000
void update_syntax_table (Lisp_Char_Table *ct);
-#endif
/* The syntax table cache */
syntax table to the cache. */
Lisp_Object object; /* The buffer or string the current
syntax cache applies to. */
- int syntax_code; /* Syntax code of current char. */
+ enum syntaxcode syntax_code; /* Syntax code of current char. */
Lisp_Object current_syntax_table; /* Syntax table for current pos. */
Lisp_Object old_prop; /* Syntax-table prop at prev pos. */
#define SETUP_SYNTAX_CACHE_FOR_BUFFER(BUFFER, FROM, COUNT) \
SETUP_SYNTAX_CACHE_FOR_OBJECT (Qnil, (BUFFER), (FROM), (COUNT))
-#ifdef UTF2000
-#define SETUP_SYNTAX_CACHE_FOR_OBJECT(OBJECT, BUFFER, FROM, COUNT) \
- do { \
- syntax_cache.buffer = (BUFFER); \
- syntax_cache.object = (OBJECT); \
- if (NILP (syntax_cache.object)) \
- { \
- XSETBUFFER (syntax_cache.object, syntax_cache.buffer); \
- } \
- else if (EQ (syntax_cache.object, Qt)) \
- { \
- XSETBUFFER (syntax_cache.object, syntax_cache.buffer); \
- } \
- else if (STRINGP (syntax_cache.object)) \
- { \
- /* do nothing */; \
- } \
- else if (BUFFERP (syntax_cache.object)) \
- { \
- syntax_cache.buffer = XBUFFER (syntax_cache.object); \
- } \
- else \
- { \
- /* OBJECT must be buffer/string/t/nil */ \
- assert(0); \
- } \
- syntax_cache.current_syntax_table \
- = syntax_cache.buffer->syntax_table; \
- syntax_cache.use_code = 0; \
- if (lookup_syntax_properties) \
- { \
- SYNTAX_CACHE_STATISTICS_COUNT_INIT; \
- update_syntax_cache ((FROM) + ((COUNT) > 0 ? 0 : -1), (COUNT)); \
- } \
- } while (0)
-#else
#define SETUP_SYNTAX_CACHE_FOR_OBJECT(OBJECT, BUFFER, FROM, COUNT) \
do { \
syntax_cache.buffer = (BUFFER); \
update_syntax_cache ((FROM) + ((COUNT) > 0 ? 0 : -1), (COUNT)); \
} \
} while (0)
-#endif
#define SYNTAX_CODE_PREFIX(c) \
((c >> 7) & 1)