Skip to content

Commit

Permalink
Update toml.py to upstream 1069d2449760525535ca77514a92e9237ee0deaf
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricedesre committed Oct 21, 2014
1 parent f6941b3 commit 38ccbe6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions python/toml/toml.py
@@ -1,4 +1,4 @@
import datetime, decimal
import datetime, decimal, re

try:
_range = xrange
Expand Down Expand Up @@ -42,7 +42,7 @@ def loads(s):
sl = list(s)
openarr = 0
openstring = False
arrayoftables = True
arrayoftables = False
beginline = True
keygroup = False
delnum = 1
Expand Down Expand Up @@ -79,7 +79,7 @@ def loads(s):
keygroup = True
else:
openarr += 1
if sl[i] == ']' and not openstring and not keygroup and not arrayoftables:
if sl[i] == ']' and not openstring:
if keygroup:
keygroup = False
elif arrayoftables:
Expand Down Expand Up @@ -251,10 +251,10 @@ def load_value(v):
newv += unicode(hx[len(hxb):])
v = newv
for i in range(len(escapes)):
v = v.replace("\\"+escapes[i], escapedchars[i])
# (where (n) signifies a member of escapes:
# undo (\\)(\\)(n) -> (\\)(\n)
v = v.replace("\\"+escapedchars[i], "\\\\"+escapes[i])
if escapes[i] == '\\':
v = v.replace("\\"+escapes[i], escapedchars[i])
else:
v = re.sub("([^\\\\](\\\\\\\\)*)\\\\"+escapes[i], "\\1"+escapedchars[i], v)
return (v[1:-1], "str")
elif v[0] == '[':
return (load_array(v), "array")
Expand Down

9 comments on commit 38ccbe6

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from metajack
at fabricedesre@38ccbe6

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging fabricedesre/servo/update-toml = 38ccbe6 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fabricedesre/servo/update-toml = 38ccbe6 merged ok, testing candidate = 6a4bde8

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from metajack
at fabricedesre@38ccbe6

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging fabricedesre/servo/update-toml = 38ccbe6 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fabricedesre/servo/update-toml = 38ccbe6 merged ok, testing candidate = cf789e4

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = cf789e4

Please sign in to comment.