From f0cc2d55067d32c1232d9483721254360d4c3bae Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 9 Sep 1996 11:11:11 -0300 Subject: BUG: a program ending in a comment without EOL made lex loops forever. --- lex.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lex.c') diff --git a/lex.c b/lex.c index cbb7b082..1a6439fa 100644 --- a/lex.c +++ b/lex.c @@ -1,4 +1,4 @@ -char *rcs_lex = "$Id: lex.c,v 2.33 1996/05/28 21:07:32 roberto Exp roberto $"; +char *rcs_lex = "$Id: lex.c,v 2.34 1996/05/30 14:04:07 roberto Exp roberto $"; #include @@ -82,7 +82,6 @@ static int read_long_string (char *yytext, int buffsize) yytext = luaI_buffer(buffsize *= 2); switch (current) { - case EOF: case 0: save(0); return WRONGTOKEN; @@ -132,10 +131,6 @@ int luaY_lex (void) int tokensize = 0; switch (current) { - case EOF: - case 0: - save(0); - return 0; case '\n': linelasttoken = ++lua_linenumber; case ' ': case '\r': /* CR: to avoid problems with DOS/Windows */ @@ -206,7 +201,6 @@ int luaY_lex (void) yytext = luaI_buffer(buffsize *= 2); switch (current) { - case EOF: case 0: case '\n': save(0); @@ -316,7 +310,7 @@ int luaY_lex (void) return NUMBER; } - default: /* also end of file */ + default: /* also end of program (0) */ { save_and_next(); return yytext[0]; -- cgit v1.2.3-55-g6feb