diff options
| -rw-r--r-- | relabel.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/relabel.lua b/relabel.lua index f849b58..5fa0db6 100644 --- a/relabel.lua +++ b/relabel.lua | |||
| @@ -80,7 +80,7 @@ for i, err in ipairs(errinfo) do | |||
| 80 | labels[err[1]] = i | 80 | labels[err[1]] = i |
| 81 | end | 81 | end |
| 82 | 82 | ||
| 83 | local errfound | 83 | local errfound = {} |
| 84 | 84 | ||
| 85 | local function expect(pattern, labelname) | 85 | local function expect(pattern, labelname) |
| 86 | local label = labels[labelname] | 86 | local label = labels[labelname] |
| @@ -328,7 +328,6 @@ end | |||
| 328 | local function compile (p, defs) | 328 | local function compile (p, defs) |
| 329 | if mm.type(p) == "pattern" then return p end -- already compiled | 329 | if mm.type(p) == "pattern" then return p end -- already compiled |
| 330 | p = p .. " " -- for better reporting of column numbers in errors when at EOF | 330 | p = p .. " " -- for better reporting of column numbers in errors when at EOF |
| 331 | errfound = {} | ||
| 332 | local cp, label, suffix = pattern:match(p, 1, defs) | 331 | local cp, label, suffix = pattern:match(p, 1, defs) |
| 333 | if #errfound > 0 then | 332 | if #errfound > 0 then |
| 334 | local lines = {} | 333 | local lines = {} |
| @@ -344,6 +343,7 @@ local function compile (p, defs) | |||
| 344 | tinsert(errors, rep(" ", col-1) .. "^") | 343 | tinsert(errors, rep(" ", col-1) .. "^") |
| 345 | end | 344 | end |
| 346 | end | 345 | end |
| 346 | errfound = {} | ||
| 347 | error(concat(errors, "\n")) | 347 | error(concat(errors, "\n")) |
| 348 | end | 348 | end |
| 349 | return cp | 349 | return cp |
