>>>> "Ben" == Ben Wing <ben(a)666.com>
writes:
> That syntax.[ch] code still makes me very nervous. Many of the
> types/macros referring to "syntax code" really mean "syntax
> class".
Ben> the terminology is questionable, true -- but what really
Ben> makes you so nervous?
Stuff like this from syntax.h:
------------------------------------------------------------------------
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);
}
#define SYNTAX_COMMENT_BITS(c) \
((SYNTAX_CODE (mirrortab, c) >> 16) &0xff)
------------------------------------------------------------------------
If SYNTAX_CODE returns an enum syntaxcode, then SYNTAX_COMMENT_BITS(c)
is identically 0 (Smax is 16 < 65536). But of course it isn't
intended to return a enum syntaxcode, really:
------------------------------------------------------------------------
#define SYNTAX_FROM_CODE(code) ((enum syntaxcode) ((code) & 0177))
#define SYNTAX(table, c) SYNTAX_FROM_CODE (SYNTAX_CODE (table, c))
------------------------------------------------------------------------
This is obfuscated at best. How can anyone safely use and maintain
routines designed this way? No wonder there's been so much lossage.
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.