aboutsummaryrefslogtreecommitdiff
path: root/examples/typedlua/tlparser.lua
diff options
context:
space:
mode:
Diffstat (limited to 'examples/typedlua/tlparser.lua')
-rw-r--r--examples/typedlua/tlparser.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/typedlua/tlparser.lua b/examples/typedlua/tlparser.lua
index dba94f7..a301fa6 100644
--- a/examples/typedlua/tlparser.lua
+++ b/examples/typedlua/tlparser.lua
@@ -226,9 +226,9 @@ end
226function tlparser.parse (subject, filename, strict, integer) 226function tlparser.parse (subject, filename, strict, integer)
227 local errorinfo = {} 227 local errorinfo = {}
228 lpeg.setmaxstack(1000) 228 lpeg.setmaxstack(1000)
229 local ast, label, _ = lpeg.match(G, subject, nil, errorinfo, strict, integer) 229 local ast, label, suffix = lpeg.match(G, subject, nil, errorinfo, strict, integer)
230 if not ast then 230 if not ast then
231 local line, col = lineno(subject, errorinfo.ffp) 231 local line, col = lineno(subject, string.len(subject) - string.len(suffix))
232 local error_msg = string.format("%s:%d:%d: ", filename, line, col) 232 local error_msg = string.format("%s:%d:%d: ", filename, line, col)
233 if label ~= 0 then 233 if label ~= 0 then
234 error_msg = error_msg .. tlerror.errors[label].msg 234 error_msg = error_msg .. tlerror.errors[label].msg