Remove duplicate __init__
All checks were successful
build / test (3.10) (push) Successful in 7s
build / test (3.11) (push) Successful in 6s
build / test (3.12) (push) Successful in 6s
build / test (3.13) (push) Successful in 6s
build / test (3.9) (push) Successful in 6s
build / lint (push) Successful in 7s
build / mypy (push) Successful in 8s
build / Build distributions (push) Successful in 8s
build / deploy (push) Has been skipped
build / test (3.10) (release) Successful in 7s
build / test (3.11) (release) Successful in 6s
build / test (3.12) (release) Successful in 6s
build / test (3.13) (release) Successful in 6s
build / test (3.9) (release) Successful in 6s
build / lint (release) Successful in 8s
build / mypy (release) Successful in 9s
build / Build distributions (release) Successful in 8s
build / deploy (release) Successful in 6s

This commit is contained in:
Byron Lathi
2025-11-23 18:34:51 -08:00
parent 672aad693a
commit 1e641913ac
3 changed files with 18 additions and 12 deletions

View File

@@ -1,2 +1,2 @@
version_info = (0, 0, 4)
version_info = (0, 0, 5)
__version__ = ".".join([str(n) for n in version_info])

View File

@@ -36,8 +36,11 @@ class Generator(RDLListener):
self.indent_level+=1
def exit_AddressableComponent(self, node: AddressableNode) -> None:
if len(node.children()) == 0:
self.f.write(f"{' '*self.indent_level*4}pass\n")
else:
self.f.write(f"{' '*self.indent_level*4}def __init__(self, addr: int = 0):\n")
self.f.write(f"{' '*self.indent_level*4} self.addr = addr\n")
self.f.write(f"{' '*self.indent_level*4} self.addr = addr:\n")
for child in node.children():
if isinstance(child, AddressableNode):

View File

@@ -1,2 +1,5 @@
class AddrNode():
addr: int
def __init__(self, addr: int = 0):
self.addr = addr