From 20dfaac6b80ad42851d82f9d2be376e098f0a5ba Mon Sep 17 00:00:00 2001 From: ptmcg Date: Sat, 27 Jun 2020 08:26:16 -0500 Subject: Add make_diagram.py to examples to demonstrate creating railroad diags for selected examples --- examples/parsePythonValue.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'examples/parsePythonValue.py') diff --git a/examples/parsePythonValue.py b/examples/parsePythonValue.py index 47f9102..4f73bfe 100644 --- a/examples/parsePythonValue.py +++ b/examples/parsePythonValue.py @@ -56,14 +56,16 @@ dictStr <<= ( ) dictStr.setParseAction(cvtDict) -tests = """['a', 100, ('A', [101,102]), 3.14, [ +2.718, 'xyzzy', -1.414] ] - [{0: [2], 1: []}, {0: [], 1: [], 2: []}, {0: [1, 2]}] - { 'A':1, 'B':2, 'C': {'a': 1.2, 'b': 3.4} } - 3.14159 - 42 - 6.02E23 - 6.02e+023 - 1.0e-7 - 'a quoted string'""" +if __name__ == "__main__": -listItem.runTests(tests) + tests = """['a', 100, ('A', [101,102]), 3.14, [ +2.718, 'xyzzy', -1.414] ] + [{0: [2], 1: []}, {0: [], 1: [], 2: []}, {0: [1, 2]}] + { 'A':1, 'B':2, 'C': {'a': 1.2, 'b': 3.4} } + 3.14159 + 42 + 6.02E23 + 6.02e+023 + 1.0e-7 + 'a quoted string'""" + + listItem.runTests(tests) -- cgit v1.2.1