def main(filename):
- grouper = StatementGrouper()
+ grouper = StatementGrouper(encoding='utf-8')
with open(filename) as infile:
for line in infile:
grouper.process_line(line)
if find_error(statement):
print("ERRORS IN QUERY")
process_statement(statement)
- print_tokens(statement)
+ print_tokens(statement, encoding='utf-8')
print()
statement._pprint_tree()
print("----------")
tokens = grouper.close()
if tokens:
for token in tokens:
- print_tokens(token)
+ print_tokens(token, encoding='utf-8')
print(repr(token))
def main(*queries):
- grouper = StatementGrouper()
+ grouper = StatementGrouper(encoding='utf-8')
for query in queries:
grouper.process_line(query)
if grouper.statements:
if find_error(statement):
print("ERRORS IN QUERY")
process_statement(statement)
- print_tokens(statement)
+ print_tokens(statement, encoding='utf-8')
print()
statement._pprint_tree()
print("----------")
tokens = grouper.close()
if tokens:
for token in tokens:
- print_tokens(token)
+ print_tokens(token, encoding='utf-8')
print(repr(token))
def main(filename):
with open(filename) as infile:
for query in infile:
- for parsed in parse(query):
+ for parsed in parse(query, encoding='utf-8'):
print("----------")
if find_error(parsed):
print("ERRORS IN QUERY")
process_statement(parsed)
- print_tokens(parsed)
+ print_tokens(parsed, encoding='utf-8')
print()
parsed._pprint_tree()
print("----------")
def main(*queries):
for query in queries:
- for parsed in parse(query):
+ for parsed in parse(query, encoding='utf-8'):
print("----------")
if find_error(parsed):
print("ERRORS IN QUERY")
process_statement(parsed)
- print_tokens(parsed)
+ print_tokens(parsed, encoding='utf-8')
print()
parsed._pprint_tree()
print("----------")