Match "#line" lines with leading whitespace

This commit is contained in:
Robin Dunn
2022-06-30 15:46:10 -07:00
parent 1a77d37cfd
commit 6238e37659

View File

@@ -1336,7 +1336,7 @@ def cmd_sip(options, args):
else:
# ...or totally remove them by replacing those lines with ''
import re
srcTxt = re.sub(r'^#line.*\n', '', srcTxt, flags=re.MULTILINE)
srcTxt = re.sub(r'^\s*#line.*\n', '', srcTxt, flags=re.MULTILINE)
className = classesNeedingClassInfo.get(os.path.basename(src))
if className:
srcTxt = injectClassInfo(className, srcTxt)