diff options
author | ptmcg <ptmcg@austin.rr.com> | 2020-06-27 08:26:16 -0500 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2020-06-27 08:26:16 -0500 |
commit | 20dfaac6b80ad42851d82f9d2be376e098f0a5ba (patch) | |
tree | 2cf9ef8ceee535a069a05399575ef763b2a6e066 /examples/delta_time.py | |
parent | b3edef08a38b45c3a5fe74968e3589996761660c (diff) | |
download | pyparsing-git-20dfaac6b80ad42851d82f9d2be376e098f0a5ba.tar.gz |
Add make_diagram.py to examples to demonstrate creating railroad diags for selected examples
Diffstat (limited to 'examples/delta_time.py')
-rw-r--r-- | examples/delta_time.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/delta_time.py b/examples/delta_time.py index 5ceff1b..5f820a9 100644 --- a/examples/delta_time.py +++ b/examples/delta_time.py @@ -309,7 +309,7 @@ time_and_day.addParseAction(save_original_string, compute_timestamp, remove_temp time_expression = time_and_day -if __name__ == "__main__": +def main(): current_time = datetime.now() # test grammar tests = """\ @@ -432,3 +432,7 @@ if __name__ == "__main__": print("(relative to %s)" % datetime.now()) time_expression.runTests(tests, postParse=verify_offset) + + +if __name__ == "__main__": + main() |