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:
Sei Lisa 2016-05-07 03:18:50 +02:00
parent 95bd3209be
commit b7e6e6f7b1
4 changed files with 23 additions and 18 deletions

View file

@ -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