1
0
mirror of synced 2024-11-12 01:00:46 +01:00

Support attributes in PSmap code generator.

This commit is contained in:
Jennifer Taylor 2020-05-12 20:59:56 +00:00
parent 67cb3de46e
commit c89a99b8dd

View File

@ -170,6 +170,12 @@ def parse_psmap(data: bytes, offset: str, rootname: str) -> Node:
node = Node.bool_array(name, [False] * elements) node = Node.bool_array(name, [False] * elements)
else: else:
node = Node.bool(name, False) node = Node.bool(name, False)
elif nodetype == 0x2F:
# Special case, this is an attribute
if name[-1] != '@':
raise Exception(f'Attribute name {name} expected to end with @')
root.set_attribute(name[:-1], '')
continue
else: else:
raise Exception(f'Unimplemented node type 0x{nodetype:02x}') raise Exception(f'Unimplemented node type 0x{nodetype:02x}')