Sat, 05 Sep 2015 23:20:17 +0100
async: Add util.async from Prosody (with logging disabled for now)
#!/usr/bin/env lua5.1 local parser = require "scansion.parser"; io.input(arg[1]); local script_data = io.read("*a"); local script = assert(parser.parse(script_data)); local c = 0; for name, object in pairs(script.objects) do local o = require("scansion.objects."..object.type); object.handler = o; o._validate(object); c = c + 1; end print("Script defines "..c.." objects, and "..#script.actions.." actions"); for _, action in pairs(script.actions) do local object = script.objects[action.object_name]; local handler = object.handler; assert(handler[action.action], "Objects of type '"..object.type.."' do not support action '"..action.action.."'"); handler[action.action](object, action.extra); end verse.loop()