Skip to content

Commit

Permalink
Filter comments when counting characters from header files and assemb…
Browse files Browse the repository at this point in the history
…ly source files.
  • Loading branch information
laqieer committed Feb 15, 2022
1 parent e231baf commit e2bae00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/butano/butano_fonts_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def list_texts_files(texts_paths):
def process_texts_files(texts_file_paths, characters_file_path):
global unique_characters
for texts_file_path in texts_file_paths:
if texts_file_path.lower().endswith('.c') or texts_file_path.lower().endswith('.cpp'):
texts_file_ext = os.path.splitext(texts_file_path.lower())[1]
if texts_file_ext in ('.c', '.cpp', '.cc', '.cxx', '.c++', '.h', '.hpp', '.hh', '.hxx', '.h++', '.s', '.inc', '.asm'):
text = subprocess.check_output([os.environ['DEVKITARM'] + '/bin/arm-none-eabi-cpp', '-fpreprocessed', texts_file_path],shell=True).decode('utf-8')
for char in text:
unique_characters.add(char)
Expand Down

0 comments on commit e2bae00

Please sign in to comment.