diff options
Diffstat (limited to 'tests/test-reject/scanner.l')
-rw-r--r-- | tests/test-reject/scanner.l | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/tests/test-reject/scanner.l b/tests/test-reject/scanner.l index 5e5208e..370e645 100644 --- a/tests/test-reject/scanner.l +++ b/tests/test-reject/scanner.l @@ -43,38 +43,41 @@ int main ( int argc, char** argv ) { FILE* fp = NULL; - void *yyscanner=0; - M4_YY_DECL_GUTS_VAR(); #ifdef TEST_IS_REENTRANT + void *yyscanner=NULL; yylex_init(&yyscanner); +#define YY_CALL_LAST_ARG , yyscanner +#define YY_CALL_ONLY_ARG yyscanner +#else +#define YY_CALL_LAST_ARG +#define YY_CALL_ONLY_ARG #endif #ifdef TEST_HAS_TABLES_EXTERNAL if((fp = fopen(argv[1],"r"))== NULL) - YY_FATAL_ERROR("could not open tables file for reading"); - if(yytables_fload(fp M4_YY_CALL_LAST_ARG) < 0) - YY_FATAL_ERROR("yytables_fload returned < 0"); - if(M4_YY_TABLES_VERIFY) - exit(0); + yy_fatal_error("could not open tables file for reading" YY_CALL_LAST_ARG); + + if(yytables_fload(fp YY_CALL_LAST_ARG) < 0) + yy_fatal_error("yytables_fload returned < 0" YY_CALL_LAST_ARG); +#ifdef YY_TABLES_VERIFY + exit(0); +#endif #endif if(argc > 2){ if((fp = fopen(argv[2],"r"))== NULL) - YY_FATAL_ERROR("could not open input file for reading"); + yy_fatal_error("could not open input file for reading" YY_CALL_LAST_ARG); yyin = fp; } - while(yylex(M4_YY_CALL_ONLY_ARG) != 0) + while(yylex(YY_CALL_ONLY_ARG) != 0) ; #ifdef TEST_HAS_TABLES_EXTERNAL - yytables_destroy(M4_YY_CALL_ONLY_ARG); + yytables_destroy(YY_CALL_ONLY_ARG); #endif - yylex_destroy(M4_YY_CALL_ONLY_ARG); - - if(argc < 0) /* silence the compiler */ - yyscanner = (void*)fp; + yylex_destroy(YY_CALL_ONLY_ARG); return 0; } |