summaryrefslogtreecommitdiff
path: root/script/src/parser/split.lua
blob: 6ce4a4e7e05e439be1e1b720ff66ec88331e1677 (plain)
1
2
3
4
5
6
7
8
9
local m = require 'lpeglabel'

local NL = m.P'\r\n' + m.S'\r\n'
local LINE = m.C(1 - NL)

return function (str)
    local MATCH = m.Ct((LINE * NL)^0 * LINE)
    return MATCH:match(str)
end