Commit Graph

7 Commits

Author SHA1 Message Date
H. Peter Anvin
1a6e76d682 pptok.c: don't insist on C99 compiler behaviour
Declarations that are not at the head is C99 behaviour, but it's
rather pointless for this little piece of code.  Fix to work with
older compilers.
2007-09-13 11:06:42 -07:00
H. Peter Anvin
7978feebd2 pptok.c: quick-and-dirty downcasing during prehashing
Speed up pptok.c by just doing |= 0x20 instead of calling tolower() for
every character during prehashing.  This is good enough for our needs,
since we don't have any tokens containing the characters @ [ \ ] _ nor
any high-bit characters (in which case we'd have to worry about multibyte
anyway.)
2007-09-12 17:02:55 +00:00
H. Peter Anvin
3100e6cb63 pptok.c: handle holes in the pp_directives array
We need to fail if we land in a hole in the pp_directives array, since
we have a noncontiguous enum preproc_token now.
2007-09-12 05:18:20 +00:00
H. Peter Anvin
da10e7b85e More automation in the preprocessor conditionals handling
Further automate the production of preprocessor conditionals.  Now the
code automatically folds if/elif and the negatives.
2007-09-12 04:18:37 +00:00
H. Peter Anvin
872460fe27 pptok.c: fix spacing 2007-09-12 02:13:39 +00:00
H. Peter Anvin
9bf0aa7c52 Generate automatically correct tests for %if and %elif
Automatically generate macros to test for %if and %elif variants, which
are guaranteed to be correct across future changes.
2007-09-12 02:12:07 +00:00
H. Peter Anvin
4169a47bd9 Use a perfect hash to look up preprocessor directives
Use a perfect hash to look up preprocessor directives, and generate
the preprocessor directive list automatically.
2007-09-12 01:29:43 +00:00