1
0
forked from VimPlug/jedi

fix tokenization of code containing unicode strings

This commit is contained in:
farhad
2014-09-14 11:34:27 +04:00
committed by farhad
parent 9983898162
commit 3747b009bf

View File

@@ -137,7 +137,7 @@ double = r'[^"\\]*(?:\\.[^"\\]*)*"'
single3 = r"[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''" single3 = r"[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''"
# Tail end of """ string. # Tail end of """ string.
double3 = r'[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""' double3 = r'[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""'
triple = group("[bB]?[rR]?'''", '[bB]?[rR]?"""') triple = group("[uUbB]?[rR]?'''", '[uUbB]?[rR]?"""')
# Single-line ' or " string. # Single-line ' or " string.
# Because of leftmost-then-longest match semantics, be sure to put the # Because of leftmost-then-longest match semantics, be sure to put the
@@ -193,7 +193,7 @@ single_quoted = {}
for t in ("'", '"', for t in ("'", '"',
"r'", 'r"', "R'", 'R"', "r'", 'r"', "R'", 'R"',
"b'", 'b"', "B'", 'B"', "b'", 'b"', "B'", 'B"',
"u'", 'u""', "U'", 'U"', "u'", 'u"', "U'", 'U"',
"br'", 'br"', "Br'", 'Br"', "br'", 'br"', "Br'", 'Br"',
"bR'", 'bR"', "BR'", 'BR"'): "bR'", 'bR"', "BR'", 'BR"'):
single_quoted[t] = t single_quoted[t] = t