aboutsummaryrefslogtreecommitdiff
path: root/nomsu.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-05-28 23:24:18 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-05-28 23:24:43 -0700
commitb6be516e3fbc082b1dbd9740b95185976f4b0040 (patch)
tree69d5b148bf9344edbbf3289f41fdf876af519e1e /nomsu.lua
parent66fa60100e64a1ec2d54e884c5d6e4a98e88fa56 (diff)
Fix for luajit, though I'm not sure why it worked for lua either.
Diffstat (limited to 'nomsu.lua')
-rw-r--r--nomsu.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/nomsu.lua b/nomsu.lua
index fcd8d38..2587080 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -1,6 +1,7 @@
local _pairs, _ipairs = pairs, ipairs
if jit then
package.cpath = "./luajit_lpeg/?.so;" .. package.cpath
+ lpeg = require("lpeglj")
bit32 = require('bit')
pairs = function(x)
do
@@ -24,9 +25,10 @@ if jit then
end
return _ipairs(x)
end
+else
+ lpeg = require('lpeg')
end
re = require('re')
-lpeg = require('lpeg')
lpeg.setmaxstack(10000)
local P, R, V, S, Cg, C, Cp, B, Cmt, Carg
P, R, V, S, Cg, C, Cp, B, Cmt, Carg = lpeg.P, lpeg.R, lpeg.V, lpeg.S, lpeg.Cg, lpeg.C, lpeg.Cp, lpeg.B, lpeg.Cmt, lpeg.Carg