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/parsePythonValue.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/parsePythonValue.py')
-rw-r--r-- | examples/parsePythonValue.py | 22 |
1 files changed, 12 insertions, 10 deletions
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) |