diff options
| author | 2020-06-27 16:12:14 -0700 | |
|---|---|---|
| committer | 2020-06-27 16:12:14 -0700 | |
| commit | 8f37b6c5aef955bb4fab4f30cdcbea6c3c4888c2 (patch) | |
| tree | 42a2c24d41a116571befa896cf6a5a0ad50d3a59 | |
| parent | Code block: rename BadLanguage attributes (diff) | |
Code block: make PY_LANG_CODES more visible
The declaration was a bit hidden between the two regular expressions.
| -rw-r--r-- | bot/cogs/codeblock/parsing.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/cogs/codeblock/parsing.py b/bot/cogs/codeblock/parsing.py index 73b6a874e..31cbd09b9 100644 --- a/bot/cogs/codeblock/parsing.py +++ b/bot/cogs/codeblock/parsing.py @@ -11,6 +11,7 @@ from bot.utils import has_lines log = logging.getLogger(__name__) BACKTICK = "`" +PY_LANG_CODES = ("python", "py") # Order is important; "py" is second cause it's a subset. _TICKS = { BACKTICK, "'", @@ -24,6 +25,7 @@ _TICKS = { "\u2033", # DOUBLE PRIME "\u3003", # VERTICAL KANA REPEAT MARK UPPER HALF } + _RE_CODE_BLOCK = re.compile( fr""" (?P<ticks> @@ -37,7 +39,6 @@ _RE_CODE_BLOCK = re.compile( re.DOTALL | re.VERBOSE ) -PY_LANG_CODES = ("python", "py") # Order is important; "py" is second cause it's a subset. _RE_LANGUAGE = re.compile( fr""" ^(?P<spaces>\s+)? # Optionally match leading spaces from the beginning. |