1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-31 07:33:00 +00:00

process improvements + new icons

This commit is contained in:
kepler155c@gmail.com
2017-09-27 15:42:40 -04:00
parent 4a608e11a2
commit 5969b71dbe
8 changed files with 113 additions and 44 deletions

View File

@@ -269,12 +269,18 @@ function page.grid:eventHandler(event)
end
function page:rawExecute(s)
local fn, m = loadstring("return (" .. s .. ')', 'lua')
if not fn then
fn, m = loadstring(s, 'lua')
local fn, m = loadstring('return (' .. s .. ')', 'lua')
if fn then
setfenv(fn, sandboxEnv)
m = { pcall(fn) }
fn = table.remove(m, 1)
if #m == 1 then
m = m[1]
end
return fn, m
end
fn, m = loadstring(s, 'lua')
if fn then
setfenv(fn, sandboxEnv)
fn, m = pcall(fn)
@@ -291,8 +297,6 @@ function page:executeStatement(statement)
if s and m then
self:setResult(m)
elseif s and type(m) == 'boolean' then
self:setResult(m)
else
self.grid:setValues({ })
self.grid:draw()