Commits

Lars Yencken committed b444ec3

Normalizes more bad tokens for dot.

Comments (0)

Files changed (1)

 
 def _normalize_token(name):
     "Rewrites any tokens which would make dot complain."
-    if name.startswith('-'):
-        return 'DASH' + name.lstrip('-')
-
+    replacements = [
+        ('-',   'DASH'),
+        (',',   'COMMA'),
+        ('(',   'LBRACKET'),
+        (')',   'RBRACKET'),
+        ('.',   'DOT'),
+    ]
+    for s, subs in replacements:
+        name = name.replace(s, subs)
+    
     return name
 
 def _find_parse(istream):