diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-12-22 09:28:48 -0800 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2018-12-22 13:46:56 -0800 |
commit | de8326d00dffdb500c02839a98330b869c2457f3 (patch) | |
tree | 6c5fdae41cf8b335ff1c64f37856786523e4fd0d /examples/jsonParser.py | |
parent | 59dfd314c23fd653271bdad37631f0497e8ad748 (diff) | |
download | pyparsing-git-de8326d00dffdb500c02839a98330b869c2457f3.tar.gz |
Trim trailing white space throughout the project
Many editors clean up trailing white space on save. By removing it all
in one go, it helps keep future diffs cleaner by avoiding spurious white
space changes on unrelated lines.
Diffstat (limited to 'examples/jsonParser.py')
-rw-r--r-- | examples/jsonParser.py | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/examples/jsonParser.py b/examples/jsonParser.py index f080c6c..6319c36 100644 --- a/examples/jsonParser.py +++ b/examples/jsonParser.py @@ -11,19 +11,19 @@ # Updated 9 Aug 2016 - use more current pyparsing constructs/idioms
#
json_bnf = """
-object
- { members }
- {}
-members
- string : value
- members , string : value
-array
+object
+ { members }
+ {}
+members
+ string : value
+ members , string : value
+array
[ elements ]
- []
-elements
- value
- elements , value
-value
+ []
+elements
+ value
+ elements , value
+value
string
number
object
@@ -55,10 +55,10 @@ memberDef = Group(jsonString + COLON + jsonValue) jsonMembers = delimitedList(memberDef)
jsonObject << Dict(LBRACE + Optional(jsonMembers) + RBRACE)
-jsonComment = cppStyleComment
+jsonComment = cppStyleComment
jsonObject.ignore(jsonComment)
-
+
if __name__ == "__main__":
testdata = """
{
@@ -66,7 +66,7 @@ if __name__ == "__main__": "title": "example glossary",
"GlossDiv": {
"title": "S",
- "GlossList":
+ "GlossList":
{
"ID": "SGML",
"SortAs": "SGML",
@@ -103,5 +103,3 @@ if __name__ == "__main__": testPrint( results.glossary.GlossDiv.GlossList.Acronym )
testPrint( results.glossary.GlossDiv.GlossList.EvenPrimesGreaterThan2 )
testPrint( results.glossary.GlossDiv.GlossList.PrimesLessThan10 )
-
-
|