mirror of
https://github.com/Reuh/candran.git
synced 2025-10-27 17:59:30 +00:00
Add Lua 5.2 target
This commit is contained in:
parent
bf4cadc349
commit
7e4b46ba7d
6 changed files with 1359 additions and 279 deletions
|
|
@ -3,13 +3,7 @@ targetName = "LuaJIT"
|
|||
UNPACK = (list, i, j)
|
||||
return "unpack(" .. list .. (i and (", " .. i .. (j and (", " .. j) or "")) or "") .. ")"
|
||||
end
|
||||
APPEND = (t, toAppend)
|
||||
return "do" .. indent() .. "local "..var("a")..", "..var("p").." = { " .. toAppend .. " }, #" .. t .. "+1" .. newline() .. "for i=1, #"..var("a").." do" .. indent() .. t .. "["..var("p").."] = "..var("a").."[i]" .. newline() .. ""..var("p").." = "..var("p").." + 1" .. unindent() .. "end" .. unindent() .. "end"
|
||||
end
|
||||
|
||||
tags._opid.idiv = (left, right)
|
||||
return "math.floor(" .. lua(left) .. " / " .. lua(right) .. ")"
|
||||
end
|
||||
tags._opid.band = (left, right)
|
||||
addRequire("bit", "band", "band")
|
||||
return var("band") .. "(" .. lua(left) .. ", " .. lua(right) .. ")"
|
||||
|
|
@ -39,6 +33,6 @@ end
|
|||
|
||||
#local patch = output
|
||||
#output = ""
|
||||
#import("compiler.lua53", { patch = patch, loadPackage = false })
|
||||
#import("compiler.lua52", { patch = patch, loadPackage = false })
|
||||
|
||||
return lua53
|
||||
return lua52
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue