Minor cleanup.

This commit is contained in:
Simon Forman 2021-11-14 08:50:30 -08:00
parent 7f193fbdbe
commit 1e38bf2029
1 changed files with 3 additions and 4 deletions

View File

@ -101,13 +101,12 @@ def _parse(tokens):
if tok == '[':
stack.append(frame)
frame = []
stack[-1].append(frame)
elif tok == ']':
try:
frame = stack.pop()
v = frame
try: frame = stack.pop()
except IndexError:
raise ParseError('Extra closing bracket.')
frame[-1] = list_to_stack(frame[-1])
frame.append(list_to_stack(v))
elif tok == 'true':
frame.append(True)
elif tok == 'false':