]> git.phdru.name Git - sqlconvert.git/blobdiff - scripts/group-sql.py
Collect lines and reparse until the last statement is complete
[sqlconvert.git] / scripts / group-sql.py
index 850dcb30b2ad1fd72f79274515feff33517f4c7b..953e9e7cfc66a03304af31cdc7473ec584fd1a7f 100755 (executable)
@@ -22,9 +22,10 @@ def main(*queries):
                 statement._pprint_tree()
             print("----------")
     tokens = grouper.close()
-    for token in tokens:
-        print_tokens(token)
-        print(repr(token))
+    if tokens:
+        for token in tokens:
+            print_tokens(token)
+            print(repr(token))
 
 
 def test():