@@ -39,8 +39,8 @@ def current_word(cursor_offset: int, line: str) -> Optional[LinePart]:
3939_match_all_dict_keys = r"""[^\]]*"""
4040
4141# https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
42- _match_single_quote_str_bytes = \
43- r""" # bytes repr() begins with `b` character; bytes and str begin with `'`
42+ _match_single_quote_str_bytes = r"""
43+ # bytes repr() begins with `b` character; bytes and str begin with `'`
4444 b?'
4545 # after an even number of `\`, next `\` and subsequent char are interpreted
4646 # as an escape sequence; this handles `\'` in the string repr()
@@ -57,8 +57,8 @@ def current_word(cursor_offset: int, line: str) -> Optional[LinePart]:
5757
5858# bytes and str repr() only uses double quotes if the string contains 1 or more
5959# `'` character and exactly 0 `"` characters
60- _match_double_quote_str_bytes = \
61- r""" # bytes repr() begins with `b` character
60+ _match_double_quote_str_bytes = r"""
61+ # bytes repr() begins with `b` character
6262 b?"
6363 # string continues until a `"` character is reached
6464 [^"]*
@@ -69,11 +69,11 @@ def current_word(cursor_offset: int, line: str) -> Optional[LinePart]:
6969_match_dict_before_key = r"""[\w_][\w0-9._]*\["""
7070
7171_current_dict_key_re = LazyReCompile (
72- f' { _match_dict_before_key } ((?:'
73- f' { _match_single_quote_str_bytes } |'
74- f' { _match_double_quote_str_bytes } |'
75- f' { _match_all_dict_keys } |)*)' ,
76- re .VERBOSE
72+ f" { _match_dict_before_key } ((?:"
73+ f" { _match_single_quote_str_bytes } |"
74+ f" { _match_double_quote_str_bytes } |"
75+ f" { _match_all_dict_keys } |)*)" ,
76+ re .VERBOSE ,
7777)
7878
7979
@@ -89,11 +89,11 @@ def current_dict_key(cursor_offset: int, line: str) -> Optional[LinePart]:
8989_capture_dict_name = r"""([\w_][\w0-9._]*)\["""
9090
9191_current_dict_re = LazyReCompile (
92- f' { _capture_dict_name } ((?:'
93- f' { _match_single_quote_str_bytes } |'
94- f' { _match_double_quote_str_bytes } |'
95- f' { _match_all_dict_keys } |)*)' ,
96- re .VERBOSE
92+ f" { _capture_dict_name } ((?:"
93+ f" { _match_single_quote_str_bytes } |"
94+ f" { _match_double_quote_str_bytes } |"
95+ f" { _match_all_dict_keys } |)*)" ,
96+ re .VERBOSE ,
9797)
9898
9999
0 commit comments