blob: e1289a66c52981f64f348eef1770525cc53b746f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
return function(utf8)
local matchers = utf8:require("modifier.compiletime.simple")
local function parse(regex, c, bs, ctx)
local functions
if ctx.prev_class then
functions = { matchers.simple(ctx.prev_class, tostring(bs)) }
ctx.prev_class = nil
end
return functions, 0
end
local function check(ctx)
if ctx.prev_class then
table.insert(ctx.funcs, matchers.simple(ctx.prev_class, tostring(ctx.pos)))
ctx.prev_class = nil
end
end
return {
parse = parse,
check = check,
}
end
|