1
0
mirror of https://github.com/kepler155c/opus synced 2025-12-17 05:38:07 +00:00

treefarm + turtle improvements + cleanup

This commit is contained in:
kepler155c@gmail.com
2017-09-12 23:04:44 -04:00
parent e50e6da700
commit 9aca96cc3e
21 changed files with 3652 additions and 1190 deletions

View File

@@ -1,5 +1,3 @@
local Util = require('util')
local Event = {
uid = 1, -- unique id for handlers
routines = { }, -- coroutines
@@ -26,7 +24,7 @@ end
function Routine:resume(event, ...)
if not self.co then
error('Cannot resume a dead routine\n' .. Util.tostring(self))
error('Cannot resume a dead routine')
end
if not self.filter or self.filter == event or event == "terminate" then
@@ -41,7 +39,7 @@ function Routine:resume(event, ...)
end
if not s and event ~= 'terminate' then
error('\n' .. (m or 'Error processing event') .. '\n' .. Util.tostring(self))
error('\n' .. (m or 'Error processing event'))
end
return s, m