mirror of
https://github.com/Reuh/candran.git
synced 2025-10-27 09:59:29 +00:00
Fixed line numbers in errors for Lua 5.1/LuaJIT, hopefully finally
for some reason gmatch("[^\n]*") matches *two times* per line (one with the line, and an empty string) in Lua 5.1 and LuaJIT, but behave as expected in Lua 5.2/5.3...
This commit is contained in:
parent
7df95abc6d
commit
da4ee63f3f
2 changed files with 5 additions and 4 deletions
|
|
@ -11,7 +11,7 @@
|
|||
#import("lib.lua-parser.parser")
|
||||
|
||||
local candran = {
|
||||
VERSION = "0.9.0"
|
||||
VERSION = "0.9.1"
|
||||
}
|
||||
|
||||
--- Default options.
|
||||
|
|
@ -248,7 +248,7 @@ function candran.messageHandler(message)
|
|||
|
||||
if originalFile then
|
||||
local i = 0
|
||||
for l in originalFile:gmatch("([^\n]*)") do
|
||||
for l in originalFile:gmatch("([^\n]*)\n") do
|
||||
i = i +1
|
||||
if i == line then
|
||||
local extSource, lineMap = l:match(".*%-%- (.-)%:(%d+)$")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue