diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-03-12 16:01:08 +0100 |
---|---|---|
committer | Benoit Giannangeli <giann@users.noreply.github.com> | 2017-03-13 11:03:24 +0100 |
commit | 4c404c404c281f1872f0283acbaee97657f3e08b (patch) | |
tree | a347635408110a0219e494876d9e54542175a645 /src/llex.js | |
parent | 632cf08572b35e8a350ac8b1f9d5bf77fb4e7b95 (diff) | |
download | fengari-4c404c404c281f1872f0283acbaee97657f3e08b.tar.gz fengari-4c404c404c281f1872f0283acbaee97657f3e08b.tar.bz2 fengari-4c404c404c281f1872f0283acbaee97657f3e08b.zip |
[Strings] lapi.js, lcode.js, llex.js, lparser.js
Diffstat (limited to 'src/llex.js')
-rw-r--r-- | src/llex.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/llex.js b/src/llex.js index 2e79066..fc3603f 100644 --- a/src/llex.js +++ b/src/llex.js @@ -218,7 +218,7 @@ const luaX_setinput = function(L, ls, z, source, firstchar) { ls.linenumber = 1; ls.lastline = 1; ls.source = source; - ls.envn = new TValue(CT.LUA_TLNGSTR, "_ENV"); + ls.envn = L.l_G.intern(lua.to_luastring("_ENV")); }; const check_next1 = function(ls, c) { @@ -356,7 +356,7 @@ const read_long_string = function(ls, seminfo, sep) { } if (seminfo) - seminfo.ts = new TValue(CT.LUA_TLNGSTR, ls.buff.buffer.slice(2 + sep).join('')); + seminfo.ts = new TValue(CT.LUA_TLNGSTR, lua.to_luastring(ls.buff.buffer.slice(2 + sep).join(''))); }; const esccheck = function(ls, c, msg) { @@ -478,7 +478,12 @@ const read_string = function(ls, del, seminfo) { } } save_and_next(ls); /* skip delimiter */ - seminfo.ts = new TValue(CT.LUA_TLNGSTR, ls.buff.buffer.slice(1, ls.buff.buffer.length-1).join('')); + seminfo.ts = new TValue( + CT.LUA_TLNGSTR, + lua.to_luastring( + ls.buff.buffer.slice(1, ls.buff.buffer.length-1).join('') + ) + ); }; const isreserved = function(w) { @@ -589,7 +594,7 @@ const llex = function(ls, seminfo) { save_and_next(ls); } while (ljstype.lislalnum(ls.current)); - let ts = new TValue(CT.LUA_TLNGSTR, ls.buff.buffer.join('')); + let ts = new TValue(CT.LUA_TLNGSTR, lua.to_luastring(ls.buff.buffer.join(''))); seminfo.ts = ts; let kidx = luaX_tokens.slice(0, 22).indexOf(ts.value); if (kidx >= 0) /* reserved word? */ |