Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Changed dict key-matching regex to capture any valid dict key
  • Loading branch information
arian-deimling committed Sep 27, 2021
commit eb321aa9ec088eb4a97ef61ab1bc6a9bb10dfb03
4 changes: 2 additions & 2 deletions bpython/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def current_word(cursor_offset: int, line: str) -> Optional[LinePart]:
return LinePart(start, end, word)


_current_dict_key_re = LazyReCompile(r"""[\w_][\w0-9._]*\[([\w0-9._(), '"]*)""")
_current_dict_key_re = LazyReCompile(r"""[\w_][\w0-9._]*\[(.*)""")


def current_dict_key(cursor_offset: int, line: str) -> Optional[LinePart]:
Expand All @@ -45,7 +45,7 @@ def current_dict_key(cursor_offset: int, line: str) -> Optional[LinePart]:
return None


_current_dict_re = LazyReCompile(r"""([\w_][\w0-9._]*)\[([\w0-9._(), '"]*)""")
_current_dict_re = LazyReCompile(r"""([\w_][\w0-9._]*)\[(.*)""")


def current_dict(cursor_offset: int, line: str) -> Optional[LinePart]:
Expand Down