mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
\\\r\n is as possible as \\\n.
This commit is contained in:
@@ -272,7 +272,7 @@ def generate_tokens(readline):
|
|||||||
indents.append(indent)
|
indents.append(indent)
|
||||||
break
|
break
|
||||||
yield NAME, token, spos, prefix
|
yield NAME, token, spos, prefix
|
||||||
elif initial == '\\' and line[start:] == '\\\n': # continued stmt
|
elif initial == '\\' and line[start:] in ('\\\n', '\\\r\n'): # continued stmt
|
||||||
additional_prefix += prefix + line[start:]
|
additional_prefix += prefix + line[start:]
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -207,3 +207,9 @@ def test_param_splitting():
|
|||||||
def test_unicode_string():
|
def test_unicode_string():
|
||||||
s = pt.String(None, u('bö'), (0, 0))
|
s = pt.String(None, u('bö'), (0, 0))
|
||||||
assert repr(s) # Should not raise an Error!
|
assert repr(s) # Should not raise an Error!
|
||||||
|
|
||||||
|
|
||||||
|
def test_backslash_dos_style():
|
||||||
|
grammar = load_grammar()
|
||||||
|
m = Parser(grammar, u('\\\r\n')).module
|
||||||
|
assert m
|
||||||
|
|||||||
Reference in New Issue
Block a user