From 542c431989bff3fc3a6687f182a8c61a7861efd9 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 12 Nov 2017 15:54:59 +1100 Subject: src/llex.js: Export LUA_ENV --- src/llex.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/llex.js b/src/llex.js index a20f308..cc3d0ef 100644 --- a/src/llex.js +++ b/src/llex.js @@ -16,6 +16,8 @@ const char = defs.char; const FIRST_RESERVED = 257; +const LUA_ENV = defs.to_luastring("_ENV", true); + const RESERVED = { /* terminal symbols denoted by reserved words */ TK_AND: FIRST_RESERVED, @@ -189,7 +191,7 @@ const luaX_setinput = function(L, ls, z, source, firstchar) { ls.linenumber = 1; ls.lastline = 1; ls.source = source; - ls.envn = lstring.luaS_newliteral(L, "_ENV"); + ls.envn = lstring.luaS_bless(L, LUA_ENV); }; const check_next1 = function(ls, c) { @@ -596,6 +598,7 @@ const luaX_lookahead = function(ls) { }; module.exports.FIRST_RESERVED = FIRST_RESERVED; +module.exports.LUA_ENV = LUA_ENV; module.exports.LexState = LexState; module.exports.RESERVED = RESERVED; module.exports.isreserved = isreserved; -- cgit v1.2.3-70-g09d2