mirror of
https://github.com/Reuh/candran.git
synced 2025-10-27 17:59:30 +00:00
Detect Lua version and slight improvement to error messages
This commit is contained in:
parent
09ac497aed
commit
aa945f9fd7
2 changed files with 4 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ local candran = {
|
||||||
|
|
||||||
--- Default options.
|
--- Default options.
|
||||||
candran.default = {
|
candran.default = {
|
||||||
target = "lua53",
|
target = _VERSION == "Lua 5.1" and "luajit" or "lua53",
|
||||||
indentation = "",
|
indentation = "",
|
||||||
newline = "\n",
|
newline = "\n",
|
||||||
variablePrefix = "__CAN_",
|
variablePrefix = "__CAN_",
|
||||||
|
|
@ -241,7 +241,7 @@ function candran.messageHandler(message)
|
||||||
for l in originalFile:gmatch("([^\n]*)") do
|
for l in originalFile:gmatch("([^\n]*)") do
|
||||||
i = i +1
|
i = i +1
|
||||||
if i == line then
|
if i == line then
|
||||||
local extSource, lineMap = l:match("%-%- (.-)%:(%d+)$")
|
local extSource, lineMap = l:match("%-%- ([^:]-)%:(%d+)$")
|
||||||
if lineMap then
|
if lineMap then
|
||||||
if extSource ~= source then
|
if extSource ~= source then
|
||||||
return indentation .. extSource .. ":" .. lineMap .. "(" .. extSource .. ":" .. line .. "):"
|
return indentation .. extSource .. ":" .. lineMap .. "(" .. extSource .. ":" .. line .. "):"
|
||||||
|
|
|
||||||
|
|
@ -2933,7 +2933,7 @@ local parser = _() or parser -- ./lib/lua-parser/parser.lua:689
|
||||||
package["loaded"]["lib.lua-parser.parser"] = parser or true -- ./lib/lua-parser/parser.lua:690
|
package["loaded"]["lib.lua-parser.parser"] = parser or true -- ./lib/lua-parser/parser.lua:690
|
||||||
local candran = { ["VERSION"] = "0.7.0-dev" } -- candran.can:13
|
local candran = { ["VERSION"] = "0.7.0-dev" } -- candran.can:13
|
||||||
candran["default"] = { -- candran.can:17
|
candran["default"] = { -- candran.can:17
|
||||||
["target"] = "lua53", -- candran.can:18
|
["target"] = _VERSION == "Lua 5.1" and "luajit" or "lua53", -- candran.can:18
|
||||||
["indentation"] = "", -- candran.can:19
|
["indentation"] = "", -- candran.can:19
|
||||||
["newline"] = "\
|
["newline"] = "\
|
||||||
", -- candran.can:20
|
", -- candran.can:20
|
||||||
|
|
@ -3116,7 +3116,7 @@ for l in originalFile:gmatch("([^\
|
||||||
]*)") do -- candran.can:241
|
]*)") do -- candran.can:241
|
||||||
i = i + 1 -- candran.can:242
|
i = i + 1 -- candran.can:242
|
||||||
if i == line then -- candran.can:243
|
if i == line then -- candran.can:243
|
||||||
local extSource, lineMap = l:match("%-%- (.-)%:(%d+)$") -- candran.can:244
|
local extSource, lineMap = l:match("%-%- ([^:]-)%:(%d+)$") -- candran.can:244
|
||||||
if lineMap then -- candran.can:245
|
if lineMap then -- candran.can:245
|
||||||
if extSource ~= source then -- candran.can:246
|
if extSource ~= source then -- candran.can:246
|
||||||
return indentation .. extSource .. ":" .. lineMap .. "(" .. extSource .. ":" .. line .. "):" -- candran.can:247
|
return indentation .. extSource .. ":" .. lineMap .. "(" .. extSource .. ":" .. line .. "):" -- candran.can:247
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue