]> git.phdru.name Git - sqlconvert.git/commitdiff
Feat(print_tokens): Remove duplicate spaces
authorOleg Broytman <phd@phdru.name>
Mon, 13 Jan 2025 17:34:54 +0000 (20:34 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 13 Jan 2025 17:34:54 +0000 (20:34 +0300)
Mostly for tests.

sqlconvert/print_tokens.py

index 6aa6fb4dbf81e229c46cc503f94ae78bcae170b3..65441b9fac42cbf9257f48d91cca63ef98b623c4 100644 (file)
@@ -18,4 +18,6 @@ def print_tokens(token_list, outfile=sys.stdout, encoding=None):
 
 
 def tlist2str(token_list):
-    return u''.join(token.normalized for token in token_list.flatten())
+    return u''.join(
+        token.normalized for token in token_list.flatten()
+    ).replace('  ', ' ')