Skip to content

Commit

Permalink
Fully comply with latest version of toml-test per #4
Browse files Browse the repository at this point in the history
The only whitespace needed on a key value pair is between the equal
sign and the value
  • Loading branch information
uiri committed Mar 5, 2013
1 parent fc5b03d commit 869f330
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,13 @@ def loads(s):
print line
i = 1
pair = line.split('=', i)
while pair[-2][-1] != ' ' and pair[-2][-1] != '\t':
while pair[-1][0] != ' ' and pair[-1][0] != '\t':
i += 1
pair = line.split('=', i)
newpair = []
newpair.append('='.join(pair[:-1]))
newpair.append(pair[-1])
pair = newpair
if pair[0] == pair[0].rstrip():
print pair[0]
raise Exception("Missing whitespace between key name and =")
pair[0] = pair[0].strip()
pair[1] = pair[1].strip()
value, vtype = load_value(pair[1])
Expand Down

0 comments on commit 869f330

Please sign in to comment.