start to think about event model
This commit is contained in:
parent
78def7f8c2
commit
c96f0e8698
|
@ -1,3 +1,5 @@
|
||||||
|
- listen to many events at once (required for vm, very useful to do away with awkward oob pattern most places)
|
||||||
|
|
||||||
debugging output:
|
debugging output:
|
||||||
- decorate classes which we expect not to be in the output, warn if we persist them
|
- decorate classes which we expect not to be in the output, warn if we persist them
|
||||||
-
|
-
|
||||||
|
@ -8,5 +10,3 @@ TRef
|
||||||
|
|
||||||
-- we do not want to hold on to references
|
-- we do not want to hold on to references
|
||||||
-- actually in our case we don't want to save GameWBs at all, we want to persist boards lazily (except for metadata?)
|
-- actually in our case we don't want to save GameWBs at all, we want to persist boards lazily (except for metadata?)
|
||||||
Cldg
|
|
||||||
-- well, this sucks :P guid? attach to game?
|
|
14
scripting.py
14
scripting.py
|
@ -437,6 +437,20 @@ class SyntSet(SyntDesc):
|
||||||
if not isinstance(val, Fail):
|
if not isinstance(val, Fail):
|
||||||
vm.Log(vm.vars.Set(self.lvalue.syntVar, vm.Pop(), self))
|
vm.Log(vm.vars.Set(self.lvalue.syntVar, vm.Pop(), self))
|
||||||
|
|
||||||
|
class SyntWhen(SyntDesc):
|
||||||
|
desc = [["When"], " ", (SyntEvent, 1), ":", (SyntBlock, 2)]
|
||||||
|
|
||||||
|
class SyntEvent(SyntDesc):
|
||||||
|
rgclsSyntEvent = []
|
||||||
|
desc = [[" "]]
|
||||||
|
@classmethod
|
||||||
|
def RgsyntReplace(cls, syntChild, st, rtype):
|
||||||
|
for clsSyntEvent in cls.rgclsSyntEvent:
|
||||||
|
if clsSyntEvent.StForTypein().lower().startswith(st.lower()):
|
||||||
|
yield clsSyntEvent.SyntDefault()
|
||||||
|
for synt in SyntExpr.RgsyntReplace(syntChild, st, rtype):
|
||||||
|
yield synt
|
||||||
|
|
||||||
#debug
|
#debug
|
||||||
@RegStmt
|
@RegStmt
|
||||||
class SyntPrint(SyntDesc):
|
class SyntPrint(SyntDesc):
|
||||||
|
|
Loading…
Reference in a new issue