diff options
author | Benoit Giannangeli <giann@users.noreply.github.com> | 2017-03-01 11:54:57 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-03-01 12:19:22 +0100 |
commit | 166b951b9d05eff654ef664124f17c8a37f418a6 (patch) | |
tree | a783d5f05cd640d06065c514b87bc7cf74f5e506 /src/lvm.js | |
parent | 94a301a27a8a75c4684790a99a898262b8354f68 (diff) | |
parent | 444182dbbb18f44cf7cafc378f092c28006be365 (diff) | |
download | fengari-166b951b9d05eff654ef664124f17c8a37f418a6.tar.gz fengari-166b951b9d05eff654ef664124f17c8a37f418a6.tar.bz2 fengari-166b951b9d05eff654ef664124f17c8a37f418a6.zip |
Merge pull request #2 from giann/feature/lex-parse
Lexing & Parsing
Diffstat (limited to 'src/lvm.js')
-rw-r--r-- | src/lvm.js | 65 |
1 files changed, 35 insertions, 30 deletions
@@ -792,6 +792,10 @@ const luaV_equalobj = function(L, t1, t2) { return L.stack[L.top].l_isfalse() ? 0 : 1; }; +const luaV_rawequalobj = function(t1, t2) { + return luaV_equalobj(null, t1, t2); +}; + const forlimit = function(obj, step) { let stopnow = false; let ilimit = luaV_tointeger(obj, step < 0 ? 2 : 1); @@ -818,9 +822,9 @@ const forlimit = function(obj, step) { /* ** try to convert a value to an integer, rounding according to 'mode': -** mode == 0: accepts only integral values -** mode == 1: takes the floor of the number -** mode == 2: takes the ceil of the number +** mode === 0: accepts only integral values +** mode === 1: takes the floor of the number +** mode === 2: takes the ceil of the number */ const luaV_tointeger = function(obj, mode) { if (obj.ttisfloat()) { @@ -831,7 +835,7 @@ const luaV_tointeger = function(obj, mode) { if (mode === 0) return false; /* fails if mode demands integral value */ else if (mode > 1) /* needs ceil? */ - f += 1; /* convert floor to ceil (remember: n != f) */ + f += 1; /* convert floor to ceil (remember: n !== f) */ } return f|0; @@ -1072,29 +1076,30 @@ const luaV_finishset = function(L, t, key, val, slot, recur) { } -module.exports.dojump = dojump; -module.exports.donextjump = donextjump; -module.exports.forlimit = forlimit; -module.exports.gettable = gettable; -module.exports.l_strcmp = l_strcmp; -module.exports.LEintfloat = LEintfloat; -module.exports.LEnum = LEnum; -module.exports.LTintfloat = LTintfloat; -module.exports.LTnum = LTnum; -module.exports.luaV_concat = luaV_concat; -module.exports.luaV_equalobj = luaV_equalobj; -module.exports.luaV_execute = luaV_execute; -module.exports.luaV_finishOp = luaV_finishOp; -module.exports.luaV_finishset = luaV_finishset; -module.exports.luaV_lessequal = luaV_lessequal; -module.exports.luaV_lessthan = luaV_lessthan; -module.exports.luaV_objlen = luaV_objlen; -module.exports.luaV_tointeger = luaV_tointeger; -module.exports.RA = RA; -module.exports.RB = RB; -module.exports.RC = RC; -module.exports.RKB = RKB; -module.exports.RKC = RKC; -module.exports.settable = settable; -module.exports.tointeger = tointeger; -module.exports.tonumber = tonumber;
\ No newline at end of file +module.exports.LEintfloat = LEintfloat; +module.exports.LEnum = LEnum; +module.exports.LTintfloat = LTintfloat; +module.exports.LTnum = LTnum; +module.exports.RA = RA; +module.exports.RB = RB; +module.exports.RC = RC; +module.exports.RKB = RKB; +module.exports.RKC = RKC; +module.exports.dojump = dojump; +module.exports.donextjump = donextjump; +module.exports.forlimit = forlimit; +module.exports.gettable = gettable; +module.exports.l_strcmp = l_strcmp; +module.exports.luaV_concat = luaV_concat; +module.exports.luaV_equalobj = luaV_equalobj; +module.exports.luaV_execute = luaV_execute; +module.exports.luaV_finishOp = luaV_finishOp; +module.exports.luaV_finishset = luaV_finishset; +module.exports.luaV_lessequal = luaV_lessequal; +module.exports.luaV_lessthan = luaV_lessthan; +module.exports.luaV_objlen = luaV_objlen; +module.exports.luaV_rawequalobj = luaV_rawequalobj; +module.exports.luaV_tointeger = luaV_tointeger; +module.exports.settable = settable; +module.exports.tointeger = tointeger; +module.exports.tonumber = tonumber;
\ No newline at end of file |