mirror of
https://github.com/leafo/moonscript.git
synced 2025-01-09 00:04:22 +00:00
Readded got()
This commit is contained in:
parent
5c6b298324
commit
592d4b0074
@ -147,6 +147,14 @@ local function pos(patt)
|
||||
return (lpeg.Cp() * patt) / insert_pos
|
||||
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)
|
||||
return function(tbl)
|
||||
if #tbl == 1 then return tbl[1] end
|
||||
|
Loading…
Reference in New Issue
Block a user