Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,14 @@ def merge_tflite_resolver(src_file, dest_file):

# Write the union back to src_file
with open(dest_file, 'w') as file:
for line in union:
if line.startswith('resolver.') and not line.endswith('\\'):
line = line + ' \\'
for index, line in enumerate(union):
if line.startswith('resolver.') and index < (len(union)-1):
# Add backslash to the end of the line unless the next line is a preprocessor directive
if not union[index+1].startswith('#'):
if not line.endswith('\\'):
line = line + ' \\'
elif line.endswith('\\'):
line = line.rstrip('\\')
file.write(line + '\n')

logger.info("Merge tflite resolver done")
Expand Down