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

Fixed using break and continue in the same loop, added vanilla Lua 5.1 target

somehow I never encountered this before... well now there's more tests
This commit is contained in:
Étienne Fildadut 2019-08-23 19:50:49 +02:00
parent ea7720b7c3
commit 91948109ca
8 changed files with 1883 additions and 1093 deletions

View file

@ -3,6 +3,7 @@
#import("compiler.lua53")
#import("compiler.luajit")
#import("compiler.lua51")
#import("lib.lua-parser.scope")
#import("lib.lua-parser.validator")
@ -10,12 +11,12 @@
#import("lib.lua-parser.parser")
local candran = {
VERSION = "0.8.0"
VERSION = "0.9.0"
}
--- Default options.
candran.default = {
target = _VERSION == "Lua 5.1" and "luajit" or "lua53",
target = "lua53",
indentation = "",
newline = "\n",
variablePrefix = "__CAN_",
@ -24,6 +25,15 @@ candran.default = {
rewriteErrors = true
}
-- Autodetect version
if _VERSION == "Lua 5.1" then
if package.loaded.jit then
candran.default.target = "luajit"
else
candran.default.target = "lua51"
end
end
--- Run the preprocessor
-- @tparam input string input code
-- @tparam options table arguments for the preprocessor. They will be inserted into the preprocessor environement.