Error flow is still klunky. We'll need to implement the output region for that.
WR2WMEPEKNFAB4CAUBVFBACAJJSX2VX5B2VHKKSNTJSJBIIXFVZQC
map = function(arr, f)
local result = {}
for _, x in ipairs(arr) do
table.insert(result, f(x))
end
return result
end
draw_canvas = function()
if Canvas == nil then return end
love.graphics.setBlendMode('alpha', 'premultiplied')
love.graphics.setColor(1,1,1,1)
love.graphics.draw(Canvas, 0,0)
love.graphics.setBlendMode('alpha')
end
Canvas = nil
local buf = table.concat(map(Editor_state.lines, function(line) return line.data end), '\n')
Canvas = love.graphics.newCanvas()
love.graphics.setCanvas(Canvas)
love.graphics.push('all')
love.graphics.setBackgroundColor(1,1,1)
love.graphics.setColor(0,0,0)
local status, result = live.eval(buf)
if not status then
print(result)
end
love.graphics.pop()
love.graphics.setCanvas()