diff options
Diffstat (limited to '')
| -rw-r--r-- | lparser.c | 14 |
1 files changed, 9 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lparser.c,v 2.73 2009/11/26 11:39:20 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.74 2010/01/05 18:46:58 roberto Exp roberto $ |
| 3 | ** Lua Parser | 3 | ** Lua Parser |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -164,10 +164,6 @@ static int registerlocalvar (LexState *ls, TString *varname) { | |||
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | 166 | ||
| 167 | #define new_localvarliteral(ls,v) \ | ||
| 168 | new_localvar(ls, luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char))-1)) | ||
| 169 | |||
| 170 | |||
| 171 | static void new_localvar (LexState *ls, TString *name) { | 167 | static void new_localvar (LexState *ls, TString *name) { |
| 172 | FuncState *fs = ls->fs; | 168 | FuncState *fs = ls->fs; |
| 173 | Varlist *vl = ls->varl; | 169 | Varlist *vl = ls->varl; |
| @@ -180,6 +176,14 @@ static void new_localvar (LexState *ls, TString *name) { | |||
| 180 | } | 176 | } |
| 181 | 177 | ||
| 182 | 178 | ||
| 179 | static void new_localvarliteral_ (LexState *ls, const char *name, size_t sz) { | ||
| 180 | new_localvar(ls, luaX_newstring(ls, name, sz)); | ||
| 181 | } | ||
| 182 | |||
| 183 | #define new_localvarliteral(ls,v) \ | ||
| 184 | new_localvarliteral_(ls, "" v, (sizeof(v)/sizeof(char))-1) | ||
| 185 | |||
| 186 | |||
| 183 | static LocVar *getlocvar (FuncState *fs, int i) { | 187 | static LocVar *getlocvar (FuncState *fs, int i) { |
| 184 | int idx = fs->ls->varl->actvar[fs->firstlocal + i].idx; | 188 | int idx = fs->ls->varl->actvar[fs->firstlocal + i].idx; |
| 185 | lua_assert(idx < fs->nlocvars); | 189 | lua_assert(idx < fs->nlocvars); |
