aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-05 16:24:59 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-05 16:24:59 -0300
commitbe8120906304a8658fab998587b969e0e42f5650 (patch)
tree81cf2d38522b10468d09763fc25d261486008197 /llex.c
parente05590591410a5e007a1e3f1691f6c1cf9d8fe45 (diff)
downloadlua-be8120906304a8658fab998587b969e0e42f5650.tar.gz
lua-be8120906304a8658fab998587b969e0e42f5650.tar.bz2
lua-be8120906304a8658fab998587b969e0e42f5650.zip
First implementation of global declarations
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/llex.c b/llex.c
index 4b5a1f75..9d93224f 100644
--- a/llex.c
+++ b/llex.c
@@ -40,11 +40,16 @@
40 40
41#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r') 41#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
42 42
43#if defined(LUA_COMPAT_GLOBAL)
44#define GLOBALLEX ".g" /* not recognizable by the scanner */
45#else
46#define GLOBALLEX "global"
47#endif
43 48
44/* ORDER RESERVED */ 49/* ORDER RESERVED */
45static const char *const luaX_tokens [] = { 50static const char *const luaX_tokens [] = {
46 "and", "break", "do", "else", "elseif", 51 "and", "break", "do", "else", "elseif",
47 "end", "false", "for", "function", "goto", "if", 52 "end", "false", "for", "function", GLOBALLEX, "goto", "if",
48 "in", "local", "nil", "not", "or", "repeat", 53 "in", "local", "nil", "not", "or", "repeat",
49 "return", "then", "true", "until", "while", 54 "return", "then", "true", "until", "while",
50 "//", "..", "...", "==", ">=", "<=", "~=", 55 "//", "..", "...", "==", ">=", "<=", "~=",