lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> If you isolate what is the issue with LPeg, I can have a  look at it.
crashes at lua 5.3.0+lpeg 0.12.1 and luajit 2.1+lpeg 0.12.1.
works at luajit 2.1+lpeg 0.10.2.
code:
local lpeg=require "lpeg"

local function count_indent(str)
  return 0
end
local Indent=lpeg.C(lpeg.S"\t "^0)/count_indent

local function parse(str)
  local function check_indent(str, pos, indent)
    return true
  end
  local CheckIndent = lpeg.Cmt(Indent, check_indent)
  return CheckIndent:match(str)
end

local function test_lpeg()
  parse(" ")
end

local function test()
  local t = os.clock()
  for k=1,10000 do test_lpeg() end
  io.write(os.clock() - t, " ")
end
for k=1,10 do test() end