Commit 98510e88 authored by Craig Barnes's avatar Craig Barnes

Use grammar:match(...) instead of lpeg.match(grammar, ...)

parent d0bc2146
Pipeline #10362605 passed with stage
in 36 seconds
......@@ -109,7 +109,7 @@ local function delim_match(subject, offset, c1, c2)
return c1 == c2
end
local grammar = {
local grammar = P {
V"Return" * V"Table" * T"EOF" + report_error();
Key = T"Number" + T"String" + T"Boolean";
......@@ -187,7 +187,7 @@ local function parse(subject, filename)
end
local errorinfo = {subject = subject, filename = filename}
lpeg.setmaxstack(1000)
return lpeg.match(grammar, subject, 1, errorinfo)
return grammar:match(subject, 1, errorinfo)
end
local function parse_file(file_or_filename)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment