Commit 6ba9be3a authored by Stefan Behnel's avatar Stefan Behnel

fix #641: parsing of raw strings

parent 5c841ce3
...@@ -766,17 +766,10 @@ def p_string_literal(s, kind_override=None): ...@@ -766,17 +766,10 @@ def p_string_literal(s, kind_override=None):
has_non_ASCII_literal_characters = True has_non_ASCII_literal_characters = True
elif sy == 'ESCAPE': elif sy == 'ESCAPE':
if is_raw: if is_raw:
if systr == u'\\\n': chars.append(systr)
chars.append(u'\\\n') if is_python3_source and not has_non_ASCII_literal_characters \
elif systr == u'\\\"': and check_for_non_ascii_characters(systr):
chars.append(u'"') has_non_ASCII_literal_characters = True
elif systr == u'\\\'':
chars.append(u"'")
else:
chars.append(systr)
if is_python3_source and not has_non_ASCII_literal_characters \
and check_for_non_ascii_characters(systr):
has_non_ASCII_literal_characters = True
else: else:
c = systr[1] c = systr[1]
if c in u"01234567": if c in u"01234567":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment