print("----- -----")
if find_error(statement):
print("ERRORS IN QUERY")
- process_statement(statement)
- print_tokens(statement, encoding='utf-8')
- print()
- statement._pprint_tree()
+ for statement in process_statement(statement):
+ print_tokens(statement, encoding='utf-8')
+ print()
+ statement._pprint_tree()
print("-----/-----")
tokens = grouper.close()
if tokens:
got_directive = is_directive_statement(statement)
if got_directive:
continue
- process_statement(statement, quoting_style)
- print_tokens(statement, outfile=outfile,
- encoding=output_encoding)
+ for statement in process_statement(statement, quoting_style):
+ print_tokens(statement, outfile=outfile,
+ encoding=output_encoding)
tokens = grouper.close()
if tokens:
for token in tokens:
requote_names(statement)
unescape_strings(statement)
escape_strings(statement, quoting_style)
+ yield statement
+ return
def test_process():
parsed = parse("select /*! test */ * from /* test */ `T`")[0]
- process_statement(parsed)
- query = tlist2str(parsed)
+ statement = next(process_statement(parsed))
+ query = tlist2str(statement)
assert query == u'SELECT * FROM /* test */ "T"'