summaryrefslogtreecommitdiff
path: root/lib/python/qmk/c_parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/c_parse.py')
-rw-r--r--lib/python/qmk/c_parse.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/python/qmk/c_parse.py b/lib/python/qmk/c_parse.py
index 08d23cf5ba..785b940456 100644
--- a/lib/python/qmk/c_parse.py
+++ b/lib/python/qmk/c_parse.py
@@ -24,7 +24,7 @@ def _get_chunks(it, size):
24 return iter(lambda: tuple(islice(it, size)), ()) 24 return iter(lambda: tuple(islice(it, size)), ())
25 25
26 26
27def _preprocess_c_file(file): 27def preprocess_c_file(file):
28 """Load file and strip comments 28 """Load file and strip comments
29 """ 29 """
30 file_contents = file.read_text(encoding='utf-8') 30 file_contents = file.read_text(encoding='utf-8')
@@ -66,7 +66,7 @@ def find_layouts(file):
66 parsed_layouts = {} 66 parsed_layouts = {}
67 67
68 # Search the file for LAYOUT macros and aliases 68 # Search the file for LAYOUT macros and aliases
69 file_contents = _preprocess_c_file(file) 69 file_contents = preprocess_c_file(file)
70 70
71 for line in file_contents.split('\n'): 71 for line in file_contents.split('\n'):
72 if layout_macro_define_regex.match(line.lstrip()) and '(' in line and 'LAYOUT' in line: 72 if layout_macro_define_regex.match(line.lstrip()) and '(' in line and 'LAYOUT' in line:
@@ -248,7 +248,7 @@ def _parse_led_config(file, matrix_cols, matrix_rows):
248 current_row_index = 0 248 current_row_index = 0
249 current_row = [] 249 current_row = []
250 250
251 for _type, value in lex(_preprocess_c_file(file), CLexer()): 251 for _type, value in lex(preprocess_c_file(file), CLexer()):
252 if not found_g_led_config: 252 if not found_g_led_config:
253 # Check for type 253 # Check for type
254 if value == 'led_config_t': 254 if value == 'led_config_t':