option to show asm and DRY.

Get ready for some 2.3 support
This commit is contained in:
rocky
2016-06-03 09:25:20 -04:00
parent 6bdddb6a58
commit eefbc40eef
11 changed files with 69 additions and 49 deletions

View File

@@ -345,6 +345,16 @@ TABLE_DIRECT = {
'kv2': ( '%c: %c', 1, 2 ),
'mapexpr': ( '{%[1]C}', (0, maxint, ', ') ),
#######################
# Python 2.3 Additions
#######################
# Import style for 2.0-2.3
'importstmt20': ( '%|import %c\n', 1),
'importstar20': ( '%|from %[1]{pattr} import *\n', ),
'importfrom20': ( '%|from %[1]{pattr} import %c\n', 2 ),
'importlist20': ( '%C', (0, sys.maxint, ', ') ),
#######################
# Python 2.5 Additions
#######################
@@ -526,7 +536,11 @@ class SourceWalker(GenericASTTraversal, object):
self.classes = []
self.pending_newlines = 0
self.hide_internal = True
self.version = version
if 2.0 <= version <= 2.3:
TABLE_DIRECT['tryfinallystmt'] = (
'%|try:\n%+%c%-%|finally:\n%+%c%-\n\n', 1, 4 )
return
f = property(lambda s: s.params['f'],
@@ -1658,7 +1672,6 @@ class SourceWalker(GenericASTTraversal, object):
else:
defparams = node[:args_node.attr]
kw_args, annotate_args = (0, 0)
pos_args = args_node.attr
pass
if self.version > 3.0 and isLambda and iscode(node[-3].attr):