1
0
mirror of synced 2024-09-23 19:08:21 +02: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)
else:
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:
raise Exception(f'Unimplemented node type 0x{nodetype:02x}')