summaryrefslogtreecommitdiff
path: root/src/lparser.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-01 11:51:00 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-01 11:51:00 +0100
commit444182dbbb18f44cf7cafc378f092c28006be365 (patch)
treea7d539ec3698c113c6cb68697bd3ec6f39b499e0 /src/lparser.js
parentae8b95ee9c3871f506b20c74367fdc9e8cb098e2 (diff)
downloadfengari-444182dbbb18f44cf7cafc378f092c28006be365.tar.gz
fengari-444182dbbb18f44cf7cafc378f092c28006be365.tar.bz2
fengari-444182dbbb18f44cf7cafc378f092c28006be365.zip
Loading tests (binary/text)
Diffstat (limited to 'src/lparser.js')
-rw-r--r--src/lparser.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lparser.js b/src/lparser.js
index 40d6c88..aa48f10 100644
--- a/src/lparser.js
+++ b/src/lparser.js
@@ -10,7 +10,6 @@ const lobject = require('./lobject.js');
const lopcode = require('./lopcodes.js');
const lua = require('./lua.js');
const BinOpr = lcode.BinOpr;
-const CT = lua.constants_type;
const OpCodesI = lopcode.OpCodesI;
const Proto = lfunc.Proto;
const R = llex.RESERVED;
@@ -239,7 +238,7 @@ const new_localvar = function(ls, name) {
};
const new_localvarliteral = function(ls, name) {
- new_localvar(ls, new TValue(CT.LUA_TLNGSTR, name));
+ new_localvar(ls, new TValue(lua.CT.LUA_TLNGSTR, name));
};
const getlocvar = function(fs, i) {
@@ -469,7 +468,7 @@ const enterblock = function(fs, bl, isloop) {
** create a label named 'break' to resolve break statements
*/
const breaklabel = function(ls) {
- let n = new TValue(CT.LUA_TLNGSTR, "break");
+ let n = new TValue(lua.CT.LUA_TLNGSTR, "break");
let l = newlabelentry(ls, ls.dyd.label, n, 0, ls.fs.pc);
findgotos(ls, ls.dyd.label.arr[l]);
};
@@ -507,7 +506,6 @@ const codeclosure = function(ls, v) {
};
const open_func = function(ls, fs, bl) {
- this.f = new Proto();
fs.prev = ls.fs; /* linked list of funcstates */
fs.ls = ls;
ls.fs = fs;
@@ -1132,7 +1130,7 @@ const gotostat = function(ls, pc) {
label = str_checkname(ls);
else {
llex.luaX_next(ls); /* skip break */
- label = new TValue(CT.LUA_TLNGSTR, "break");
+ label = new TValue(lua.CT.LUA_TLNGSTR, "break");
}
let g = newlabelentry(ls, ls.dyd.gt, label, line, pc);
findlabel(ls, g); /* close it if label already defined */
@@ -1538,7 +1536,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(CT.LUA_TLNGSTR, name);
+ funcstate.f.source = new TValue(lua.CT.LUA_TLNGSTR, name);
lexstate.buff = buff;
lexstate.dyd = dyd;
dyd.actvar.n = dyd.gt.n = dyd.label.n = 0;