projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04b9ac7
)
Assert that tokens are initialized in a somewhat correct order.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Mon, 10 Dec 2007 19:07:24 +0000
(19:07 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Mon, 10 Dec 2007 19:07:24 +0000
(19:07 +0000)
[r18656]
token.c
patch
|
blob
|
history
diff --git
a/token.c
b/token.c
index
3a30ddd
..
c8aa47d
100644
(file)
--- a/
token.c
+++ b/
token.c
@@
-16,10
+16,15
@@
source_position_t builtin_source_position = { "<built-in>", 0 };
void init_tokens(void)
{
symbol_t *symbol;
+ int last_id = -2;
memset(token_symbols, 0, T_LAST_TOKEN * sizeof(token_symbols[0]));
#define T(mode,x,str,val) \
+ if (T_##x > 255) { \
+ assert(T_##x >= last_id); \
+ last_id = T_##x; \
+ } \
if (c_mode & (mode)) { \
assert(T_##x >= 0 && T_##x < T_LAST_TOKEN); \
symbol = symbol_table_insert(str); \