LUA-ZeroBrane IDE:编译特性

LUA-ZeroBrane IDE:编译特性,lua,compilation,zerobrane,Lua,Compilation,Zerobrane,在ZeroBrane Studio中,如果我使用“Project-complile(F7)”,会发生什么 是否会有一个独立的.exe从我的Lua代码创建 如果是,在哪个目录中? 我使用Windows10。 (在文档中找不到任何信息)通过快速查看源代码,我只需使用编译文件的加载字符串来检查代码是否有任何错误。 没有输出文件,只有一些关于任何错误的文本输出 但这只是一个假设。当您单击该按钮时,请随时检查这是否是实际调用的函数 如果在资源管理器中搜索项目的每个子目录,会发现什么?“干净”项目和您已经

在ZeroBrane Studio中,如果我使用“Project-complile(F7)”,会发生什么
是否会有一个独立的.exe从我的Lua代码创建
如果是,在哪个目录中? 我使用Windows10。
(在文档中找不到任何信息)

通过快速查看源代码,我只需使用编译文件的
加载字符串来检查代码是否有任何错误。
没有输出文件,只有一些关于任何错误的文本输出

但这只是一个假设。当您单击该按钮时,请随时检查这是否是实际调用的函数


如果在资源管理器中搜索项目的每个子目录,会发现什么?“干净”项目和您已经构建(使用“项目-编译”)的项目之间有什么不同?我不确定是否有项目的子目录。。。。我有一个单LUA文件:…\ZeroBraneStudio\myprograms\test1.LUA,如果我编译它,它会说:编译成功;成功率100%(1/1)。因此,编译是成功的,但结果如何?这是正确的;编译只是确认它使用与运行IDE本身相同的Lua解释器通过语法检查(LUA5.1—与LUA5.2的几个扩展兼容)。有一个(特定于版本),但尚未实现。
function CompileProgram(editor, params)
  local params = {
    jumponerror = (params or {}).jumponerror ~= false,
    reportstats = (params or {}).reportstats ~= false,
    keepoutput = (params or {}).keepoutput,
  }
  local doc = ide:GetDocument(editor)
  local filePath = doc:GetFilePath() or doc:GetFileName()
  local loadstring = loadstring or load
  local func, err = loadstring(StripShebang(editor:GetTextDyn()), '@'..filePath)
  local line = not func and tonumber(err:match(":(%d+)%s*:")) or nil

  if not params.keepoutput then ClearOutput() end

  compileTotal = compileTotal + 1
  if func then
    compileOk = compileOk + 1
    if params.reportstats then
      ide:Print(TR("Compilation successful; %.0f%% success rate (%d/%d).")
        :format(compileOk/compileTotal*100, compileOk, compileTotal))
    end
  else
    ide:GetOutput():Activate()
    ide:Print(TR("Compilation error").." "..TR("on line %d"):format(line)..":")
    ide:Print((err:gsub("\n$", "")))
    -- check for escapes invalid in LuaJIT/Lua 5.2 that are allowed in Lua 5.1
    if err:find('invalid escape sequence') then
      local s = editor:GetLineDyn(line-1)
      local cleaned = s
        :gsub('\\[abfnrtv\\"\']', '  ')
        :gsub('(\\x[0-9a-fA-F][0-9a-fA-F])', function(s) return string.rep(' ', #s) end)
        :gsub('(\\%d%d?%d?)', function(s) return string.rep(' ', #s) end)
        :gsub('(\\z%s*)', function(s) return string.rep(' ', #s) end)
      local invalid = cleaned:find("\\")
      if invalid then
        ide:Print(TR("Consider removing backslash from escape sequence '%s'.")
          :format(s:sub(invalid,invalid+1)))
      end
    end
    if line and params.jumponerror and line-1 ~= editor:GetCurrentLine() then
      editor:GotoLine(line-1)
    end
  end

  return func ~= nil -- return true if it compiled ok
end