aboutsummaryrefslogtreecommitdiff
path: root/examples/listId1.lua
diff options
context:
space:
mode:
Diffstat (limited to 'examples/listId1.lua')
-rw-r--r--examples/listId1.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/listId1.lua b/examples/listId1.lua
index b7943c1..9bba783 100644
--- a/examples/listId1.lua
+++ b/examples/listId1.lua
@@ -13,14 +13,14 @@ local g = m.P{
13} 13}
14 14
15function mymatch (g, s) 15function mymatch (g, s)
16 local r, e, sfail = g:match(s) 16 local r, e, pos = g:match(s)
17 if not r then 17 if not r then
18 local line, col = re.calcline(s, #s - #sfail) 18 local line, col = re.calcline(s, pos)
19 local msg = "Error at line " .. line .. " (col " .. col .. ")" 19 local msg = "Error at line " .. line .. " (col " .. col .. ")"
20 if e == 1 then 20 if e == 1 then
21 return r, msg .. ": expecting an identifier before '" .. sfail .. "'" 21 return r, msg .. ": expecting an identifier before '" .. s:sub(pos) .. "'"
22 elseif e == 2 then 22 elseif e == 2 then
23 return r, msg .. ": expecting ',' before '" .. sfail .. "'" 23 return r, msg .. ": expecting ',' before '" .. s:sub(pos) .. "'"
24 else 24 else
25 return r, msg 25 return r, msg
26 end 26 end