Readded got()

This commit is contained in:
mpeterv 2014-03-22 10:53:40 +04:00
parent 5c6b298324
commit 592d4b0074

View File

@ -147,6 +147,14 @@ local function pos(patt)
return (lpeg.Cp() * patt) / insert_pos return (lpeg.Cp() * patt) / insert_pos
end end
local function got(what)
return Cmt("", function(str, pos, ...)
local cap = {...}
print("++ got "..what, "["..extract_line(str, pos).."]")
return true
end)
end
local function flatten_or_mark(name) local function flatten_or_mark(name)
return function(tbl) return function(tbl)
if #tbl == 1 then return tbl[1] end if #tbl == 1 then return tbl[1] end