aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_lexer.l
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-12 08:58:03 +1000
committerDavid Walter Seikel2012-01-12 08:58:03 +1000
commitf4ca01557b072577bb6ba6dc5992d72988f13589 (patch)
tree5ddf0aff36485562a8531fe781003d7bbab0adfe /LuaSL/src/LuaSL_lexer.l
parentMake the lexer more reentrant, and piss off yyerror. (diff)
downloadSledjHamr-f4ca01557b072577bb6ba6dc5992d72988f13589.zip
SledjHamr-f4ca01557b072577bb6ba6dc5992d72988f13589.tar.gz
SledjHamr-f4ca01557b072577bb6ba6dc5992d72988f13589.tar.bz2
SledjHamr-f4ca01557b072577bb6ba6dc5992d72988f13589.tar.xz
A failed attempt to handle multiple files.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_lexer.l14
1 files changed, 12 insertions, 2 deletions
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
151 151
152int yywrap(yyscan_t yyscanner) 152int yywrap(yyscan_t yyscanner)
153{ 153{
154#ifdef LUASL_FILES
155 LuaSL_yyparseExtra *extra = yyget_extra(yyscanner);
156#endif
157 int result = 1;
158
154#ifdef FLEX_SCANNER 159#ifdef FLEX_SCANNER
155 #ifndef LL_WINDOWS 160 #ifndef LL_WINDOWS
156 // Get gcc to stop complaining about lack of use of yyunput and input. 161 // Get gcc to stop complaining about lack of use of yyunput and input.
@@ -158,7 +163,12 @@ int yywrap(yyscan_t yyscanner)
158 (void) input; 163 (void) input;
159 #endif 164 #endif
160#endif 165#endif
161// 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. 166
162 return(1); 167#ifdef LUASL_FILES
168 result = nextFile(extra);
169 if (0 == result)
170 yyset_in(extra->file, yyscanner);
171#endif
172 return result;
163} 173}
164 174