First implementation of global declarations

This commit is contained in:
Roberto Ierusalimschy
2025-05-05 16:24:59 -03:00
parent e055905914
commit be81209063
10 changed files with 272 additions and 117 deletions

7
llex.c
View File

@@ -40,11 +40,16 @@
#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
#if defined(LUA_COMPAT_GLOBAL)
#define GLOBALLEX ".g" /* not recognizable by the scanner */
#else
#define GLOBALLEX "global"
#endif
/* ORDER RESERVED */
static const char *const luaX_tokens [] = {
"and", "break", "do", "else", "elseif",
"end", "false", "for", "function", "goto", "if",
"end", "false", "for", "function", GLOBALLEX, "goto", "if",
"in", "local", "nil", "not", "or", "repeat",
"return", "then", "true", "until", "while",
"//", "..", "...", "==", ">=", "<=", "~=",