From 5ffef3da93ad53069d2510a75b11ecbb1b6e8aa7 Mon Sep 17 00:00:00 2001 From: Sérgio Queiroz Date: Fri, 8 Dec 2017 10:11:50 -0300 Subject: Updating the examples since lpeglabel now returns an error position instead of a string and p^lab is syntatic sugar --- examples/typedlua/tlparser.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/typedlua/tlparser.lua') diff --git a/examples/typedlua/tlparser.lua b/examples/typedlua/tlparser.lua index a301fa6..2ede2eb 100644 --- a/examples/typedlua/tlparser.lua +++ b/examples/typedlua/tlparser.lua @@ -226,9 +226,9 @@ end function tlparser.parse (subject, filename, strict, integer) local errorinfo = {} lpeg.setmaxstack(1000) - local ast, label, suffix = lpeg.match(G, subject, nil, errorinfo, strict, integer) + local ast, label, pos = lpeg.match(G, subject, nil, errorinfo, strict, integer) if not ast then - local line, col = lineno(subject, string.len(subject) - string.len(suffix)) + local line, col = lineno(subject, pos) local error_msg = string.format("%s:%d:%d: ", filename, line, col) if label ~= 0 then error_msg = error_msg .. tlerror.errors[label].msg -- cgit v1.2.3-55-g6feb