@@ -1635,7 +1635,9 @@ def CacheScript(self, name, path = None, line = None):
1635
1635
functions ["ONINIT" ] = Statement (self .STAT_EVENTDEF , 0 , EventDef (None , "ONINIT" , "OnInit" , [], []))
1636
1636
functions ["ONBEGINSTATE" ] = Statement (self .STAT_EVENTDEF , 0 , EventDef (None , "ONBEGINSTATE" , "OnBeginState" , [], []))
1637
1637
functions ["ONENDSTATE" ] = Statement (self .STAT_EVENTDEF , 0 , EventDef (None , "ONENDSTATE" , "OnEndState" , [], []))
1638
- i = 0
1638
+ else :
1639
+ self .Abort ("The first statement in '%s' is not a script header." % name )
1640
+ i = 1
1639
1641
while i < len (statements ):
1640
1642
if statements [i ].type == self .STAT_FUNCTIONDEF or statements [i ].type == self .STAT_EVENTDEF :
1641
1643
start = statements [i ]
@@ -1668,10 +1670,6 @@ def CacheScript(self, name, path = None, line = None):
1668
1670
states [statements [i ].data .name ] = start
1669
1671
while i < len (statements ) and not (statements [i ].type == self .STAT_KEYWORD and statements [i ].data .type == self .KW_ENDSTATE ):
1670
1672
i += 1
1671
- elif statements [i ].type == self .STAT_SCRIPTHEADER :
1672
- if not header and statements [i ].data .parent :
1673
- header = True
1674
- extends = self .GetLineage (statements [i ].data .parent )
1675
1673
i += 1
1676
1674
1677
1675
self .cache [name ] = CachedScript (extends , properties , functions , states )
0 commit comments