Skip to content

Commit

Permalink
make LAYOUT parsing more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
skullydazed committed Feb 25, 2021
1 parent ba0b965 commit 23ef327
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/python/qmk/c_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ def find_layouts(file):
layout = layout.strip()
parsed_layout = [_default_key(key) for key in layout.split(',')]

for key in parsed_layout:
if key['label'] in matrix_locations:
for i, key in enumerate(parsed_layout):
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']]

parsed_layouts[macro_name] = {
Expand Down

0 comments on commit 23ef327

Please sign in to comment.