]> granicus.if.org Git - python/commitdiff
Limit which operators get colorized
authorRaymond Hettinger <python@rcn.com>
Sun, 1 Jul 2012 07:37:05 +0000 (00:37 -0700)
committerRaymond Hettinger <python@rcn.com>
Sun, 1 Jul 2012 07:37:05 +0000 (00:37 -0700)
Tools/scripts/pycolorize.py

index 6d43313c0ea3ef94191371c440bfade70f58805c..576d473f58fd0d209d870603b41af624fa22e3bd 100755 (executable)
@@ -28,7 +28,7 @@ def colorize(source):
         kind, prev_kind = '', kind
         if tok_type == tokenize.COMMENT:
             kind = 'comment'
-        elif tok_type == tokenize.OP:
+        elif tok_type == tokenize.OP and tok_str[:1] not in '{}[](),.:;':
             kind = 'operator'
         elif tok_type == tokenize.STRING:
             kind = 'string'