Condense a sequence of newlines after a /*! directive */;
+ Rename remove_directives -> remove_directive_tokens.
+
Version 0.0.5 (2016-09-07)
Remove /*! directives */; and newlines after them.
return True
-def remove_directives(statement):
+def remove_directive_tokens(statement):
"""Remove /*! directives */ from the first-level"""
new_tokens = []
for token in statement.tokens:
def process_statement(statement):
- remove_directives(statement)
+ remove_directive_tokens(statement)
requote_names(statement)
from sqlparse import parse
from sqlconvert.print_tokens import tlist2str
-from sqlconvert.process_mysql import remove_directives, requote_names, \
+from sqlconvert.process_mysql import remove_directive_tokens, requote_names, \
is_directive_statement, process_statement
from tests import main
def test_directive(self):
parsed = parse("select /*! test */ * from /* test */ `T`")[0]
- remove_directives(parsed)
+ remove_directive_tokens(parsed)
query = tlist2str(parsed)
self.assertEqual(query, 'SELECT * FROM /* test */ `T`')