mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Bytes literal.
This commit is contained in:
parent
cf297e46b8
commit
00e41defe8
15 changed files with 179 additions and 19 deletions
|
@ -745,9 +745,11 @@ class Transformer:
|
|||
return eval(lit)
|
||||
|
||||
def atom_string(self, nodelist):
|
||||
k = ''
|
||||
for node in nodelist:
|
||||
k = self.decode_literal(nodelist[0][1])
|
||||
for node in nodelist[1:]:
|
||||
k += self.decode_literal(node[1])
|
||||
if isinstance(k, bytes):
|
||||
return Bytes(str(k), lineno=nodelist[0][2])
|
||||
return Const(k, lineno=nodelist[0][2])
|
||||
|
||||
def atom_ellipsis(self, nodelist):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue