1
0
Fork 0

make LAYOUT parsing more robust

This commit is contained in:
Zach White 2021-02-24 10:35:08 -08:00 committed by Zach White
parent ba0b965c42
commit 23ef327e11

View file

@ -67,8 +67,10 @@ def find_layouts(file):
layout = layout.strip() layout = layout.strip()
parsed_layout = [_default_key(key) for key in layout.split(',')] parsed_layout = [_default_key(key) for key in layout.split(',')]
for key in parsed_layout: for i, key in enumerate(parsed_layout):
if key['label'] in matrix_locations: if 'label' not in key:
cli.log.error('Invalid LAYOUT macro in %s: Empty parameter name in macro %s at pos %s.', file, macro_name, i)
elif key['label'] in matrix_locations:
key['matrix'] = matrix_locations[key['label']] key['matrix'] = matrix_locations[key['label']]
parsed_layouts[macro_name] = { parsed_layouts[macro_name] = {