mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-24 13:21:20 +00:00
Revert "Lua 'global' keyword, only for functions for now because I'm tired"
This reverts commit db4dc10100
.
This commit is contained in:
parent
c097101e48
commit
ffbca6a646
3 changed files with 2 additions and 18 deletions
|
@ -38,7 +38,7 @@
|
|||
const char *const luaX_tokens [] = {
|
||||
"and", "break", "continue", "do", "else", "elseif",
|
||||
"end", "false", "for", "function", "if",
|
||||
"in", "local", "global", "nil", "not", "or", "repeat",
|
||||
"in", "local", "nil", "not", "or", "repeat",
|
||||
"return", "then", "true", "until", "while",
|
||||
"..", "...", "==", ">=", "<=", "~=",
|
||||
"<number>", "<name>", "<string>", "<eof>",
|
||||
|
|
|
@ -25,7 +25,7 @@ enum RESERVED {
|
|||
/* terminal symbols denoted by reserved words */
|
||||
TK_AND = FIRST_RESERVED, TK_BREAK, TK_CONTINUE,
|
||||
TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION,
|
||||
TK_IF, TK_IN, TK_LOCAL, TK_GLOBAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT,
|
||||
TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT,
|
||||
TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,
|
||||
/* other terminal symbols */
|
||||
TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER,
|
||||
|
|
|
@ -1349,16 +1349,6 @@ static void localfunc (LexState *ls) {
|
|||
}
|
||||
|
||||
|
||||
static void globalfunc (LexState *ls) {
|
||||
expdesc v, b;
|
||||
FuncState *fs = ls->fs;
|
||||
init_exp(&v, VGLOBAL, NO_REG);
|
||||
v.u.s.info = luaK_stringK(fs, str_checkname(ls));
|
||||
body(ls, &b, 0, ls->linenumber);
|
||||
luaK_storevar(fs, &v, &b);
|
||||
}
|
||||
|
||||
|
||||
static void localstat (LexState *ls) {
|
||||
/* stat -> LOCAL NAME {`,' NAME} [`=' explist1] */
|
||||
int nvars = 0;
|
||||
|
@ -1498,12 +1488,6 @@ static int statement (LexState *ls) {
|
|||
localstat(ls);
|
||||
return 0;
|
||||
}
|
||||
case TK_GLOBAL: { /* stat -> globalstat */
|
||||
luaX_next(ls); /* skip GLOBAL */
|
||||
if (testnext(ls, TK_FUNCTION))
|
||||
globalfunc(ls);
|
||||
return 0;
|
||||
}
|
||||
case TK_RETURN: { /* stat -> retstat */
|
||||
retstat(ls);
|
||||
return 1; /* must be last statement */
|
||||
|
|
Loading…
Reference in a new issue