further work on supporting single and multiple fstring decompilation

This commit is contained in:
moagstar
2016-10-20 20:44:27 +02:00
parent 7beaa9f36c
commit cec80e696c
4 changed files with 22 additions and 9 deletions

View File

@@ -633,7 +633,8 @@ class SourceWalker(GenericASTTraversal, object):
#######################
TABLE_DIRECT.update({
'fstring_expr': ( "{%c%{conversion}}", 0),
'fstring': ( "f'%c'", 0),
'fstring_single': ( "f'{%c%{conversion}}'", 0),
'fstring_multi': ( "f'%c'", 0),
})
return
@@ -1893,6 +1894,9 @@ class SourceWalker(GenericASTTraversal, object):
node.conversion = self.FSTRING_CONVERSION_MAP.get(node.data[1].attr, '')
self.default(node)
def n_fstring_single(self, node):
return self.n_fstring_expr(node)
def engine(self, entry, startnode):
"""The format template interpetation engine. See the comment at the
beginning of this module for the how we interpret format specifications such as