Correct parser to ignore escaped quotes when not in quotes already

Related to #8481
release1.7.1
James Cammarata 10 years ago
parent bb1ca99db7
commit da08e62017

@ -26,9 +26,9 @@ def _get_quote_state(token, quote_char):
for idx, cur_char in enumerate(token):
if idx > 0:
prev_char = token[idx-1]
if cur_char in '"\'':
if cur_char in '"\'' and prev_char != '\\':
if quote_char:
if cur_char == quote_char and prev_char != '\\':
if cur_char == quote_char:
quote_char = None
else:
quote_char = cur_char

Loading…
Cancel
Save