File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 41
41
42
42
43
43
#include < QtCore/qglobal.h>
44
+ #include < iostream>
44
45
45
46
#include " tokens.h"
46
47
@@ -152,7 +153,8 @@ static char const * const _S_token_names[] = {
152
153
" xor" ,
153
154
" xor_eq" ,
154
155
" Q_ENUMS" ,
155
- " Q_ENUM"
156
+ " Q_ENUM" ,
157
+ " Q_INVOKABLE"
156
158
};
157
159
158
160
static char _S_printable[][2 ] = {
@@ -254,6 +256,18 @@ static char _S_printable[][2] = {
254
256
{ char (127 ), ' \0 ' },
255
257
};
256
258
259
+ int check_tokens_consistency ()
260
+ {
261
+ if (sizeof (_S_token_names) / sizeof (_S_token_names[0 ]) != TOKEN_KIND_COUNT - Token_K_DCOP)
262
+ {
263
+ std::cerr << " ** ERROR enum TOKEN_KIND and _S_token_names are not consistent" << std::endl;
264
+ abort ();
265
+ }
266
+ return 0 ;
267
+ }
268
+
269
+ static int tokens_consistency = check_tokens_consistency();
270
+
257
271
char const *token_name (int token)
258
272
{
259
273
if (token == 0 )
@@ -264,9 +278,9 @@ char const *token_name(int token)
264
278
{
265
279
return _S_printable[token - 32 ];
266
280
}
267
- else if (token >= 1000 )
281
+ else if (token >= Token_K_DCOP )
268
282
{
269
- return _S_token_names[token - 1000 ];
283
+ return _S_token_names[token - Token_K_DCOP ];
270
284
}
271
285
272
286
Q_ASSERT (0 );
You can’t perform that action at this time.
0 commit comments