From db60d46e72f1cbec5a45010abadd0b66434ea8a7 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 3 Aug 2016 23:49:42 +0300 Subject: [PATCH] Parse command-line queries separately --- scripts/print_subtree.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/print_subtree.py b/scripts/print_subtree.py index 8a37d95..100fa64 100755 --- a/scripts/print_subtree.py +++ b/scripts/print_subtree.py @@ -23,14 +23,15 @@ def test(): print("----------") -def main(query): - for parsed in parse(query): +def main(*queries): + for query in queries: + for parsed in parse(query): + print("----------") + requote_names(parsed) + print_tokens(parsed) + print() + parsed._pprint_tree() print("----------") - requote_names(parsed) - print_tokens(parsed) - print() - parsed._pprint_tree() - print("----------") if __name__ == '__main__': if len(sys.argv) <= 1: @@ -39,5 +40,5 @@ if __name__ == '__main__': if sys.argv[1] == '-t': test() else: - query = ';'.join(sys.argv[1:]) - main(query) + queries = sys.argv[1:] + main(*queries) -- 2.39.5