Remove compat code in parser when not needed
This commit is contained in:
2
llex.c
2
llex.c
@@ -41,7 +41,7 @@
|
|||||||
#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
|
#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
|
||||||
|
|
||||||
#if defined(LUA_COMPAT_GLOBAL)
|
#if defined(LUA_COMPAT_GLOBAL)
|
||||||
#define GLOBALLEX ".g" /* not recognizable by the scanner */
|
#define GLOBALLEX ".g" /* anything not recognizable as a name */
|
||||||
#else
|
#else
|
||||||
#define GLOBALLEX "global"
|
#define GLOBALLEX "global"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1997,6 +1997,7 @@ static void statement (LexState *ls) {
|
|||||||
gotostat(ls, line);
|
gotostat(ls, line);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if defined(LUA_COMPAT_GLOBAL)
|
||||||
case TK_NAME: {
|
case TK_NAME: {
|
||||||
/* compatibility code to parse global keyword when "global"
|
/* compatibility code to parse global keyword when "global"
|
||||||
is not reserved */
|
is not reserved */
|
||||||
@@ -2008,7 +2009,9 @@ static void statement (LexState *ls) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} /* else... */
|
} /* else... */
|
||||||
} /* FALLTHROUGH */
|
}
|
||||||
|
#endif
|
||||||
|
/* FALLTHROUGH */
|
||||||
default: { /* stat -> func | assignment */
|
default: { /* stat -> func | assignment */
|
||||||
exprstat(ls);
|
exprstat(ls);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user