From f4ca01557b072577bb6ba6dc5992d72988f13589 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 12 Jan 2012 08:58:03 +1000 Subject: A failed attempt to handle multiple files. --- LuaSL/src/LuaSL_lexer.l | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'LuaSL/src/LuaSL_lexer.l') diff --git a/LuaSL/src/LuaSL_lexer.l b/LuaSL/src/LuaSL_lexer.l index b4a1444..93df410 100644 --- a/LuaSL/src/LuaSL_lexer.l +++ b/LuaSL/src/LuaSL_lexer.l @@ -151,6 +151,11 @@ int common(YYSTYPE *lval, char *text, LuaSL_yyparseExtra *extra, boolean checkIg int yywrap(yyscan_t yyscanner) { +#ifdef LUASL_FILES + LuaSL_yyparseExtra *extra = yyget_extra(yyscanner); +#endif + int result = 1; + #ifdef FLEX_SCANNER #ifndef LL_WINDOWS // Get gcc to stop complaining about lack of use of yyunput and input. @@ -158,7 +163,12 @@ int yywrap(yyscan_t yyscanner) (void) input; #endif #endif -// TODO - If we are getting files from stdin, or multiple -f arguments, we should loop through them and return 0. Return 1 when there are no more files. - return(1); + +#ifdef LUASL_FILES + result = nextFile(extra); + if (0 == result) + yyset_in(extra->file, yyscanner); +#endif + return result; } -- cgit v1.1