1
0
mirror of https://github.com/myhdl/myhdl.git synced 2024-12-14 07:44:38 +08:00

3.9 serves a tuple

This commit is contained in:
Josy Boelen 2021-03-07 10:53:12 +01:00
parent 55e823e939
commit 48f7a5897c
2 changed files with 5 additions and 4 deletions

View File

@ -969,7 +969,7 @@ class _AnalyzeVisitor(ast.NodeVisitor, _ConversionMixin):
self.generic_visit(node) self.generic_visit(node)
def visit_Subscript(self, node): def visit_Subscript(self, node):
print(node.slice) print('Analyze', node.slice)
if isinstance(node.slice, ast.Slice): if isinstance(node.slice, ast.Slice):
self.accessSlice(node) self.accessSlice(node)
else: else:

View File

@ -1132,11 +1132,12 @@ class _ConvertVisitor(ast.NodeVisitor, _ConversionMixin):
s = "1'b%s" % int(obj) s = "1'b%s" % int(obj)
elif isinstance(obj, int): elif isinstance(obj, int):
s = self.IntRepr(obj) s = self.IntRepr(obj)
# elif isinstance(obj, tuple): # Python3.9+ ast.Index serves a tuple elif isinstance(obj, tuple): # Python3.9+ ast.Index serves a tuple
# print(obj) print(obj)
s = n
# # print(ast.dump(ast.parse('l[i]', mode='eval'))) # # print(ast.dump(ast.parse('l[i]', mode='eval')))
# # Expression(body=Subscript(value=Name(id='l', ctx=Load()), slice=Index(value=Name(id='i', ctx=Load())), ctx=Load())) # # Expression(body=Subscript(value=Name(id='l', ctx=Load()), slice=Index(value=Name(id='i', ctx=Load())), ctx=Load()))
# s = str(obj[0])
elif isinstance(obj, _Signal): elif isinstance(obj, _Signal):
addSignBit = isMixedExpr addSignBit = isMixedExpr
s = str(obj) s = str(obj)