Author Topic: EGSL interpreter and Zerobrane Studio IDE  (Read 3322 times)

igamealot

  • Guest
EGSL interpreter and Zerobrane Studio IDE
« on: January 18, 2013, 10:01:28 PM »
On Wednesday we got murgaLua working with Zerobrane Studio's Lua IDE.

It took seconds to get EGSL working with it as well, and I just stumbled in here.
Didn't even know what EGSL was. But here we go.

For this script to work it is saved as 'egsl.lua' in ZeroBraneStudio/interpreters/

The way it is written for Windows you simply drop the EGSL folder into ZeroBraneStudio/bin/
Other OS need testing.

In ZeroBrane Studio IDE :open an EGSL Lua script
Choose menu Project > Lua Interpreter > esgl (basic)
Choose menu Project > Run (F6)

Should work perfectly with the graphics window appearing and everything. Its really cool.
Code: [Select]
local exe

local function exePath()
  local mainpath = ide.editorFilename:gsub("[^/\\]+$","")
  local macExe = mainpath..'bin/murgaLua'
  return (ide.osname == "Windows" and mainpath..[[bin\EGSL\egsl.exe]]
     or  (ide.osname == "Unix" and [[egsl]]) -- using installed murgaLua
     or  (wx.wxFileExists(macExe) and macExe or mainpath..[[bin/egsl]]))
end

return {
  name = "egsl (basic)",
  description = "egsl interpreter with debugger",
  api = {"baselib"},
  frun = function(self,wfilename,rundebug)
    exe = exe or exePath()
     if rundebug then DebuggerAttachDefault() end

    local cmd = ('"%s" "%s"'):format(exe, wfilename:GetFullPath())
    -- CommandLineRun(cmd,wdir,tooutput,nohide,stringcallback,uid,endcallback)
    return CommandLineRun(cmd,self:fworkdir(wfilename),true,false,nil,nil,
      function() ide.debugger.pid = nil end)
  end,
  fprojdir = function(self,wfilename)
    return wfilename:GetPath(wx.wxPATH_GET_VOLUME)
  end,
  fworkdir = function (self,wfilename)
    return ide.config.path.projectdir or wfilename:GetPath(wx.wxPATH_GET_VOLUME)
  end,
  hasdebugger = true,
  fattachdebug = function(self) DebuggerAttachDefault() end,
  skipcompile = true,
  scratchextloop = true,
  unhideanywindow = true,

}

Update with links and egsl.lua attached as egsl.txt because the forum is finicky about '.lua'
« Last Edit: January 18, 2013, 10:33:05 PM by igamealot »

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: EGSL interpreter and Zerobrane Studio IDE
« Reply #1 on: January 18, 2013, 10:29:03 PM »
Oh, this IDE looks excellent. I will have to try it this weekend.