File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def __init__(self):
9999 def transform (self , tree ):
100100 """Transform an AST into a modified parse tree."""
101101 if type (tree ) != type (()) and type (tree ) != type ([]):
102- tree = parser .ast2tuple (tree ,1 )
102+ tree = parser .ast2tuple (tree , line_info = 1 )
103103 return self .compile_node (tree )
104104
105105 def parsesuite (self , text ):
@@ -657,7 +657,9 @@ def power(self, nodelist):
657657 return node
658658
659659 def atom (self , nodelist ):
660- return self ._atom_dispatch [nodelist [0 ][0 ]](nodelist )
660+ n = self ._atom_dispatch [nodelist [0 ][0 ]](nodelist )
661+ n .lineno = nodelist [0 ][2 ]
662+ return n
661663
662664 def atom_lpar (self , nodelist ):
663665 if nodelist [1 ][0 ] == token .RPAR :
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def __init__(self):
9999 def transform (self , tree ):
100100 """Transform an AST into a modified parse tree."""
101101 if type (tree ) != type (()) and type (tree ) != type ([]):
102- tree = parser .ast2tuple (tree ,1 )
102+ tree = parser .ast2tuple (tree , line_info = 1 )
103103 return self .compile_node (tree )
104104
105105 def parsesuite (self , text ):
@@ -657,7 +657,9 @@ def power(self, nodelist):
657657 return node
658658
659659 def atom (self , nodelist ):
660- return self ._atom_dispatch [nodelist [0 ][0 ]](nodelist )
660+ n = self ._atom_dispatch [nodelist [0 ][0 ]](nodelist )
661+ n .lineno = nodelist [0 ][2 ]
662+ return n
661663
662664 def atom_lpar (self , nodelist ):
663665 if nodelist [1 ][0 ] == token .RPAR :
You can’t perform that action at this time.
0 commit comments