Skip to content

Instantly share code, notes, and snippets.

@smellman
Forked from tetsuharuohzeki/patch.diff
Created October 3, 2012 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smellman/3827504 to your computer and use it in GitHub Desktop.
Save smellman/3827504 to your computer and use it in GitHub Desktop.
Preprocesser.py bug fix patch
# HG changeset patch
# Parent 635fcc11d2b16265114d6bbc02768d007f73d66b
# User Taro Matsuzawa <btm@tech.email.ne.jp>
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