]> git.phdru.name Git - sqlconvert.git/commitdiff
Do not output statement separators in print_tokens
authorOleg Broytman <phd@phdru.name>
Wed, 3 Aug 2016 16:01:22 +0000 (19:01 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 3 Aug 2016 16:01:22 +0000 (19:01 +0300)
mysql2sql/print_tokens.py
scripts/print_subtree.py

index 2024c67a948b5fa9c61ce8310f8e65160aea83d4..0f03d0357f151bc3af02380e9be94bebae0d98a9 100644 (file)
@@ -16,8 +16,6 @@ def print_tokens(token_list, outfile=sys.stdout, level=0):
             outfile.write(token.normalized)
         if isinstance(token, TokenList):
             print_tokens(token, outfile, level+1)
-    if level == 0:
-        outfile.write(';\n')
 
 
 def get_tokens_str(token_list):
index 84ea88a9e39a2d13e5aa8914b8fa18ae22696832..f1da6de13caf4f515be588764e96e715124479aa 100755 (executable)
@@ -18,6 +18,7 @@ def test():
         for parsed in parse(query):
             requote_names(parsed)
             print_tokens(parsed)
+            print()
             parsed._pprint_tree()
     print("----------")
 
@@ -26,6 +27,7 @@ def main(query):
     parsed = parse(query)[0]
     requote_names(parsed)
     print_tokens(parsed)
+    print()
     parsed._pprint_tree()
 
 if __name__ == '__main__':