Skip to content

Commit

Permalink
Make UNICODE_RE Final and accept multiline strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivansh-007 committed Mar 16, 2022
1 parent 125ebec commit af86102
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
5 changes: 3 additions & 2 deletions src/black/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
r"^([" + STRING_PREFIX_CHARS + r"]*)(.*)$", re.DOTALL
)
FIRST_NON_WHITESPACE_RE: Final = re.compile(r"\s*\t+\s*(\S)")
UNICODE_RE = re.compile(
UNICODE_RE: Final = re.compile(
r"(\\+)("
r"(u([a-zA-Z0-9]{4}))" # Formatting 16-bit unicodes i.e. \uxxxx
r"|(U([a-zA-Z0-9]{0,8}))" # Formatting 32-bit unicodes i.e. \Uxxxxxxxx
r"|(x([a-zA-Z0-9]{2}))" # Formatting unicodes in format of \xhh
r"|(N\{([a-zA-Z0-9]{2})\})" # Formatting named unicodes in format of \N{name}
r")"
r")",
re.MULTILINE,
)


Expand Down
10 changes: 0 additions & 10 deletions test.py

This file was deleted.

0 comments on commit af86102

Please sign in to comment.