mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Fix bug with tab handling.
Commit 5804a9a
introduced a bug where having the foldtabs option disabled (normal) prevented optimizations of functions. Fix it for good (hopefully). While on it, rename the nofoldtabs option to warntabs, making it default, and use it to disable a warning when there are tabs in a string.
This commit is contained in:
parent
95bd3209be
commit
b7e6e6f7b1
4 changed files with 23 additions and 18 deletions
|
@ -57,7 +57,8 @@ class optimizer(foldconst, renamer, deadcode):
|
|||
ret['X'] = value['X']
|
||||
return ret
|
||||
|
||||
def optimize(self, treesymtab, options = ('optimize','constfold','dcr')):
|
||||
def optimize(self, treesymtab, options = ('optimize','constfold','dcr',
|
||||
'warntabs')):
|
||||
"""Optimize the symbolic table symtab in place. Requires a table of
|
||||
predefined functions for folding constants.
|
||||
"""
|
||||
|
@ -68,7 +69,7 @@ class optimizer(foldconst, renamer, deadcode):
|
|||
self.addstrings = 'addstrings' in options
|
||||
|
||||
self.foldtabs = 'foldtabs' in options
|
||||
self.nofoldtabs = 'nofoldtabs' in options
|
||||
self.warntabs = 'warntabs' in options
|
||||
|
||||
self.shrinknames = 'shrinknames' in options
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue