MCPcopy
hub / github.com/KhronosGroup/Vulkan-Docs / deperiodizeFile

Function deperiodizeFile

scripts/deperiodize_vuids.py:15–25  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

13import os,re
14
15def deperiodizeFile(filename):
16 print(f' Deperiodizing = {filename}')
17
18 with open(filename, 'r', encoding='utf8', newline='\n') as f:
19 data = f.read()
20
21 # Remove periods from VUs
22 data = re.sub( r'( \* \[\[VUID\-[\s\S]+?)\.?(?=(\n \* \[\[VUID\-)|(\n\*\*\*\*)|(\n// )|(\ninclude::)|(\nendif::)|(\nifdef::)|(\nifndef::))', r'\g<1>', data )
23
24 with open(filename, 'w', encoding='utf8', newline='\n') as f:
25 data = f.write(data)
26
27def deperiodizeFolder(folder):
28 print(f' Parsing = {folder}')

Callers 1

deperiodizeFolderFunction · 0.85

Calls 2

subMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected