pragmas are no longer supported

This commit is contained in:
Roberto Ierusalimschy 2000-08-22 17:07:56 -03:00
parent e662e0f1cd
commit 5c0e79847c
1 changed files with 5 additions and 17 deletions

22
llex.c
View File

@ -1,5 +1,5 @@
/*
** $Id: llex.c,v 1.66 2000/08/08 20:42:07 roberto Exp roberto $
** $Id: llex.c,v 1.67 2000/08/09 19:16:57 roberto Exp roberto $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@ -113,20 +113,6 @@ static void inclinenumber (LexState *LS) {
}
static void checkpragma (lua_State *L, LexState *LS) {
static const char *const pragmas [] = {"debug", "nodebug", NULL};
if (LS->current == '$') { /* is a pragma? */
switch (luaL_findstring(readname(L, LS)+1, pragmas)) {
case 0: /* debug */
case 1: /* nodebug */
break;
default:
luaX_error(LS, "unknown pragma", TK_STRING);
}
}
}
void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source) {
LS->L = L;
LS->lookahead.token = TK_EOS; /* no look-ahead token */
@ -141,7 +127,6 @@ void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source) {
next(LS);
} while (LS->current != '\n' && LS->current != EOZ);
}
else checkpragma(L, LS);
}
@ -247,9 +232,12 @@ int luaX_lex (LexState *LS) {
case '\n':
inclinenumber(LS);
checkpragma(L, LS);
continue;
case '$':
luaX_error(LS, "unexpected `$' (pragmas are no longer supported)", '$');
break;
case '-':
next(LS);
if (LS->current != '-') return '-';