Mercurial > hg
changeset 29277:79a11506803f
check-code: use fixedmap for replacement of space characters
This can centralize management of fixed replacement into fixedmap.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Tue, 31 May 2016 21:02:30 +0900 |
parents | 4dd530df4742 |
children | 5eda83fb09fc |
files | contrib/check-code.py |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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():