Skip to content

Instantly share code, notes, and snippets.

@tetsuharuohzeki
Forked from smellman/gist:3385103
Created October 3, 2012 15:11
Show Gist options
  • Save tetsuharuohzeki/3827471 to your computer and use it in GitHub Desktop.
Save tetsuharuohzeki/3827471 to your computer and use it in GitHub Desktop.
Preprocesser.py bug fix patch
# HG changeset patch
# Parent 635fcc11d2b16265114d6bbc02768d007f73d66b
# User smellman? <???@???.???>
diff --git a/config/Preprocessor.py b/config/Preprocessor.py
--- a/config/Preprocessor.py
+++ b/config/Preprocessor.py
@@ -377,16 +377,18 @@ class Preprocessor:
# Strips blank lines from the output.
def filter_emptyLines(self, aLine):
if aLine == '\n':
return ''
return aLine
# slashslash
# Strips everything after //
def filter_slashslash(self, aLine):
+ if (aLine.find('//') == -1):
+ return aLine
[aLine, rest] = aLine.split('//', 1)
if rest:
aLine += '\n'
return aLine
# spaces
# Collapses sequences of spaces into a single space
def filter_spaces(self, aLine):
return re.sub(' +', ' ', aLine).strip(' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment