summaryrefslogtreecommitdiff
path: root/tests/test-table-opts/scanner.l
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-table-opts/scanner.l')
-rw-r--r--tests/test-table-opts/scanner.l28
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/test-table-opts/scanner.l b/tests/test-table-opts/scanner.l
index 3ad6199..b7f5b76 100644
--- a/tests/test-table-opts/scanner.l
+++ b/tests/test-table-opts/scanner.l
@@ -45,38 +45,40 @@ foo|bar ;
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");
+ yy_fatal_error("could not open tables file for reading" YY_CALL_LAST_ARG);
- if(yytables_fload(fp M4_YY_CALL_LAST_ARG) < 0)
- YY_FATAL_ERROR("yytables_fload returned < 0");
- if(M4_YY_TABLES_VERIFY)
+ if(yytables_fload(fp YY_CALL_LAST_ARG) < 0)
+ yy_fatal_error("yytables_fload returned < 0" YY_CALL_LAST_ARG);
+#ifdef TEST_HAS_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;
}