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/lparser.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/lparser.js')
-rw-r--r-- | src/lparser.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lparser.js b/src/lparser.js index 7fa3f16..42337cc 100644 --- a/src/lparser.js +++ b/src/lparser.js @@ -248,7 +248,7 @@ const new_localvar = function(ls, name) { }; const new_localvarliteral = function(ls, name) { - new_localvar(ls, new TValue(lua.CT.LUA_TLNGSTR, name)); + new_localvar(ls, new TValue(lua.CT.LUA_TLNGSTR, lua.to_luastring(name))); }; const getlocvar = function(fs, i) { @@ -479,7 +479,7 @@ const enterblock = function(fs, bl, isloop) { ** create a label named 'break' to resolve break statements */ const breaklabel = function(ls) { - let n = new TValue(lua.CT.LUA_TLNGSTR, "break"); + let n = new TValue(lua.CT.LUA_TLNGSTR, lua.to_luastring("break")); let l = newlabelentry(ls, ls.dyd.label, n, 0, ls.fs.pc); findgotos(ls, ls.dyd.label.arr[l]); }; @@ -1141,7 +1141,7 @@ const gotostat = function(ls, pc) { label = str_checkname(ls); else { llex.luaX_next(ls); /* skip break */ - label = new TValue(lua.CT.LUA_TLNGSTR, "break"); + label = new TValue(lua.CT.LUA_TLNGSTR, lua.to_luastring("break")); } let g = newlabelentry(ls, ls.dyd.gt, label, line, pc); findlabel(ls, g); /* close it if label already defined */ @@ -1547,7 +1547,7 @@ const luaY_parser = function(L, z, buff, dyd, name, firstchar) { lexstate.h = new Table(); /* create table for scanner */ L.stack[L.top++] = lexstate.h; funcstate.f = cl.p = new Proto(L); - funcstate.f.source = new TValue(lua.CT.LUA_TLNGSTR, name); + funcstate.f.source = new TValue(lua.CT.LUA_TLNGSTR, lua.to_luastring(name)); lexstate.buff = buff; lexstate.dyd = dyd; dyd.actvar.n = dyd.gt.n = dyd.label.n = 0; |