mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Move a block. No functionality changes.
This commit is contained in:
parent
9c66380972
commit
93828b9286
1 changed files with 33 additions and 33 deletions
|
@ -31,39 +31,6 @@ class lastpass(object):
|
||||||
nt = node['nt']
|
nt = node['nt']
|
||||||
child = node['ch'] if 'ch' in node else None
|
child = node['ch'] if 'ch' in node else None
|
||||||
|
|
||||||
if nt == 'FNDEF':
|
|
||||||
# StChAreBad will be True if this is a user-defined function,
|
|
||||||
# where state changes are considered bad.
|
|
||||||
# BadStCh will be True if at least one state change statement
|
|
||||||
# is found while monitoring state changes.
|
|
||||||
self.subinfo['StChAreBad'] = 'scope' in node
|
|
||||||
self.BadStCh = False
|
|
||||||
return
|
|
||||||
|
|
||||||
if nt == 'IF':
|
|
||||||
if len(child) == 2:
|
|
||||||
# Don't monitor the children.
|
|
||||||
self.subinfo['StChAreBad'] = False
|
|
||||||
return
|
|
||||||
|
|
||||||
if nt == 'DO':
|
|
||||||
self.subinfo['StChAreBad'] = False
|
|
||||||
return
|
|
||||||
|
|
||||||
if nt == 'FOR':
|
|
||||||
self.subinfo['StChAreBad'] = False
|
|
||||||
return
|
|
||||||
|
|
||||||
if nt == 'WHILE':
|
|
||||||
self.subinfo['StChAreBad'] = False
|
|
||||||
return
|
|
||||||
|
|
||||||
if nt == 'STSW':
|
|
||||||
if self.subinfo['StChAreBad']:
|
|
||||||
# Found one.
|
|
||||||
self.BadStCh = True
|
|
||||||
return
|
|
||||||
|
|
||||||
if (self.optlistadd and not self.globalmode
|
if (self.optlistadd and not self.globalmode
|
||||||
and (nt == 'CONST' and node['t'] == 'list' or nt == 'LIST'
|
and (nt == 'CONST' and node['t'] == 'list' or nt == 'LIST'
|
||||||
or nt == '+' and child[0]['t'] == 'list' and
|
or nt == '+' and child[0]['t'] == 'list' and
|
||||||
|
@ -106,6 +73,39 @@ class lastpass(object):
|
||||||
|
|
||||||
del listnode, left
|
del listnode, left
|
||||||
|
|
||||||
|
if nt == 'FNDEF':
|
||||||
|
# StChAreBad will be True if this is a user-defined function,
|
||||||
|
# where state changes are considered bad.
|
||||||
|
# BadStCh will be True if at least one state change statement
|
||||||
|
# is found while monitoring state changes.
|
||||||
|
self.subinfo['StChAreBad'] = 'scope' in node
|
||||||
|
self.BadStCh = False
|
||||||
|
return
|
||||||
|
|
||||||
|
if nt == 'IF':
|
||||||
|
if len(child) == 2:
|
||||||
|
# Don't monitor the children.
|
||||||
|
self.subinfo['StChAreBad'] = False
|
||||||
|
return
|
||||||
|
|
||||||
|
if nt == 'DO':
|
||||||
|
self.subinfo['StChAreBad'] = False
|
||||||
|
return
|
||||||
|
|
||||||
|
if nt == 'FOR':
|
||||||
|
self.subinfo['StChAreBad'] = False
|
||||||
|
return
|
||||||
|
|
||||||
|
if nt == 'WHILE':
|
||||||
|
self.subinfo['StChAreBad'] = False
|
||||||
|
return
|
||||||
|
|
||||||
|
if nt == 'STSW':
|
||||||
|
if self.subinfo['StChAreBad']:
|
||||||
|
# Found one.
|
||||||
|
self.BadStCh = True
|
||||||
|
return
|
||||||
|
|
||||||
def LastPassPostOrder(self, parent, index):
|
def LastPassPostOrder(self, parent, index):
|
||||||
node = parent[index]
|
node = parent[index]
|
||||||
nt = node['nt']
|
nt = node['nt']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue