diff options
Diffstat (limited to 'examples/tiny.lua')
-rw-r--r-- | examples/tiny.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/tiny.lua b/examples/tiny.lua index 734536c..cc718e7 100644 --- a/examples/tiny.lua +++ b/examples/tiny.lua | |||
@@ -90,9 +90,9 @@ local g = re.compile[[ | |||
90 | 90 | ||
91 | 91 | ||
92 | local function mymatch(g, s) | 92 | local function mymatch(g, s) |
93 | local r, e, sfail = g:match(s) | 93 | local r, e, pos = g:match(s) |
94 | if not r then | 94 | if not r then |
95 | local line, col = re.calcline(s, #s - #sfail) | 95 | local line, col = re.calcline(s, pos) |
96 | local msg = "Error at line " .. line .. " (col " .. col .. "): " | 96 | local msg = "Error at line " .. line .. " (col " .. col .. "): " |
97 | return r, msg .. terror[e].msg | 97 | return r, msg .. terror[e].msg |
98 | end | 98 | end |