1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2025-10-27 09:59:29 +00:00

Detect Lua version and slight improvement to error messages

This commit is contained in:
Étienne Fildadut 2019-04-05 20:10:44 +02:00
parent 09ac497aed
commit aa945f9fd7
2 changed files with 4 additions and 4 deletions

View file

@ -15,7 +15,7 @@ local candran = {
--- Default options.
candran.default = {
target = "lua53",
target = _VERSION == "Lua 5.1" and "luajit" or "lua53",
indentation = "",
newline = "\n",
variablePrefix = "__CAN_",
@ -241,7 +241,7 @@ function candran.messageHandler(message)
for l in originalFile:gmatch("([^\n]*)") do
i = i +1
if i == line then
local extSource, lineMap = l:match("%-%- (.-)%:(%d+)$")
local extSource, lineMap = l:match("%-%- ([^:]-)%:(%d+)$")
if lineMap then
if extSource ~= source then
return indentation .. extSource .. ":" .. lineMap .. "(" .. extSource .. ":" .. line .. "):"