Skip to content

Commit

Permalink
Fix code issues google#2
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenvincent27 committed Jan 13, 2021
1 parent 7f75168 commit 705e8d9
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions fire/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,12 @@ def _LiteralEval(value):

# Skip all delimiters occuring after this
while ptr < len(value) and value[ptr] in delimiter:
if value[ptr] == '}':
if brace_stack:
brace_stack.pop()

if value[ptr] == '}' and brace_stack:
brace_stack.pop()
if not brace_stack:
# All potential dictionaries exited,
# remove colon (:) from delimiter
delimiter.discard(':')
delimiter.remove(':')

ptr += 1
else:
Expand All @@ -170,14 +168,14 @@ def _LiteralEval(value):

# Skip all delimiters occuring after this
while ptr < len(value) and value[ptr] in delimiter:
if value[ptr] == '}':
if brace_stack:
brace_stack.pop()

if value[ptr] == '}' and brace_stack:
brace_stack.pop()
if not brace_stack:
# All potential dictionaries exited,
# remove colon (:) from delimiter
delimiter.discard(':')
delimiter.remove(':')

ptr += 1

root = ast.parse(value, mode='eval')

Expand Down

0 comments on commit 705e8d9

Please sign in to comment.