Skip to content

Commit

Permalink
Fixed errors in Parser.parse doctests.
Browse files Browse the repository at this point in the history
  • Loading branch information
smilliken committed Jul 16, 2016
1 parent d58353a commit b37ee85
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions plists/v1parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,43 +35,43 @@ def parse(self, string_or_stream):
"""
Parses the input stream and returns a dictionary or list at the root of the stream.
>>> Parser("3").parse()
>>> Parser().parse("3")
3
>>> Parser("'abc'").parse()
>>> Parser().parse("'abc'")
'abc'
>>> Parser("()").parse()
>>> Parser().parse("()")
[]
>>> Parser("(1)").parse()
>>> Parser().parse("(1)")
[1]
>>> Parser("(1;)").parse()
>>> Parser().parse("(1;)")
[1]
>>> Parser("(1; 2; 3)").parse()
>>> Parser().parse("(1; 2; 3)")
[1, 2, 3]
>>> Parser("(1; (a; b; c;))").parse()
>>> Parser().parse("(1; (a; b; c;))")
[1, [a, b, c]]
>>> Parser("{}").parse()
>>> Parser().parse("{}")
{}
>>> Parser("{'a' = 1;}").parse()
>>> Parser().parse("{'a' = 1;}")
{'a': 1}
>>> Parser("{ident = (1; 2)}").parse()
>>> Parser().parse("{ident = (1; 2)}")
{ident: [1, 2]}
>>> Parser("{ident1 = 1; ident2 = 2}").parse()
>>> Parser().parse("{ident1 = 1; ident2 = 2}")
{ident2: 2, ident1: 1}
>>> Parser("{ident = ()}").parse()
>>> Parser().parse("{ident = ()}")
{ident: []}
>>> Parser("{ident = hello/world}").parse()
>>> Parser().parse("{ident = hello/world}")
{ident: hello/world}
"""
self.scanner = Scanner(string_or_stream)
Expand Down

0 comments on commit b37ee85

Please sign in to comment.