check-code: use fixedmap for replacement of space characters
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Tue, 31 May 2016 21:02:30 +0900
changeset 29277 79a11506803f
parent 29276 4dd530df4742
child 29278 5eda83fb09fc
check-code: use fixedmap for replacement of space characters This can centralize management of fixed replacement into fixedmap.
contrib/check-code.py
--- a/contrib/check-code.py	Tue May 31 20:58:10 2016 +0900
+++ b/contrib/check-code.py	Tue May 31 21:02:30 2016 +0900
@@ -51,13 +51,11 @@
     return re.compile(pat)
 
 def repquote(m):
-    fixedmap = {'.': 'p', ':': 'q'}
+    fixedmap = {' ': ' ', '\n': '\n', '.': 'p', ':': 'q'}
     def encodechr(i):
         if i > 255:
             return 'u'
         c = chr(i)
-        if c in ' \n':
-            return c
         if c in fixedmap:
             return fixedmap[c]
         if c.isalpha():