diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-22 17:07:56 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-22 17:07:56 -0300 |
| commit | 5c0e79847c2a7a8006b0270210de56b53cb33564 (patch) | |
| tree | 4b388d1cbc6545db8dc7082e4c08f25a32d853f3 | |
| parent | e662e0f1cdc132dc76033c423c13134cdaa20cf6 (diff) | |
| download | lua-5c0e79847c2a7a8006b0270210de56b53cb33564.tar.gz lua-5c0e79847c2a7a8006b0270210de56b53cb33564.tar.bz2 lua-5c0e79847c2a7a8006b0270210de56b53cb33564.zip | |
pragmas are no longer supported
| -rw-r--r-- | llex.c | 22 |
1 files changed, 5 insertions, 17 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llex.c,v 1.66 2000/08/08 20:42:07 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.67 2000/08/09 19:16:57 roberto Exp roberto $ |
| 3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -113,20 +113,6 @@ static void inclinenumber (LexState *LS) { | |||
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | 115 | ||
| 116 | static void checkpragma (lua_State *L, LexState *LS) { | ||
| 117 | static const char *const pragmas [] = {"debug", "nodebug", NULL}; | ||
| 118 | if (LS->current == '$') { /* is a pragma? */ | ||
| 119 | switch (luaL_findstring(readname(L, LS)+1, pragmas)) { | ||
| 120 | case 0: /* debug */ | ||
| 121 | case 1: /* nodebug */ | ||
| 122 | break; | ||
| 123 | default: | ||
| 124 | luaX_error(LS, "unknown pragma", TK_STRING); | ||
| 125 | } | ||
| 126 | } | ||
| 127 | } | ||
| 128 | |||
| 129 | |||
| 130 | void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source) { | 116 | void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source) { |
| 131 | LS->L = L; | 117 | LS->L = L; |
| 132 | LS->lookahead.token = TK_EOS; /* no look-ahead token */ | 118 | 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) { | |||
| 141 | next(LS); | 127 | next(LS); |
| 142 | } while (LS->current != '\n' && LS->current != EOZ); | 128 | } while (LS->current != '\n' && LS->current != EOZ); |
| 143 | } | 129 | } |
| 144 | else checkpragma(L, LS); | ||
| 145 | } | 130 | } |
| 146 | 131 | ||
| 147 | 132 | ||
| @@ -247,9 +232,12 @@ int luaX_lex (LexState *LS) { | |||
| 247 | 232 | ||
| 248 | case '\n': | 233 | case '\n': |
| 249 | inclinenumber(LS); | 234 | inclinenumber(LS); |
| 250 | checkpragma(L, LS); | ||
| 251 | continue; | 235 | continue; |
| 252 | 236 | ||
| 237 | case '$': | ||
| 238 | luaX_error(LS, "unexpected `$' (pragmas are no longer supported)", '$'); | ||
| 239 | break; | ||
| 240 | |||
| 253 | case '-': | 241 | case '-': |
| 254 | next(LS); | 242 | next(LS); |
| 255 | if (LS->current != '-') return '-'; | 243 | if (LS->current != '-') return '-'; |
