|
| 1 | +from typing import List, Tuple |
| 2 | + |
1 | 3 | from pygments.lexer import Lexer, bygroups, using |
2 | 4 | from pygments.lexers.css import CssLexer |
3 | 5 | from pygments.lexers.javascript import JavascriptLexer |
4 | 6 | from pygments.lexers.python import PythonLexer |
5 | 7 | from pygments.lexers.templates import HtmlDjangoLexer |
6 | | -from pygments.token import Name, Text, Operator, String, Punctuation |
| 8 | +from pygments.token import Name, Operator, Punctuation, String, Text |
7 | 9 |
|
8 | 10 |
|
9 | 11 | # Since this Lexer will be used only in documentation, it's a naive implementation |
|
32 | 34 | # ``` |
33 | 35 | # |
34 | 36 | # But our implementation still highlights the latter. |
35 | | -def _gen_code_block_capture_rule(var_name: str, next_state: str) -> tuple[str, str, str]: |
| 37 | +def _gen_code_block_capture_rule(var_name: str, next_state: str) -> Tuple[str, str, str]: |
36 | 38 | # In Pygments, capture rules are defined as a tuple of 3 elements: |
37 | 39 | # - The pattern to capture |
38 | 40 | # - The token to highlight |
@@ -65,7 +67,7 @@ def _gen_code_block_capture_rule(var_name: str, next_state: str) -> tuple[str, s |
65 | 67 |
|
66 | 68 |
|
67 | 69 | # This generates capture rules for when we are already inside the code block |
68 | | -def _gen_code_block_rules(lexer: Lexer) -> list[tuple[str, str, str]]: |
| 70 | +def _gen_code_block_rules(lexer: Lexer) -> List[Tuple[str, str, str]]: |
69 | 71 | return [ |
70 | 72 | # We're inside the code block and we came across a """ or ''', |
71 | 73 | # so the code block ends. |
|
0 commit comments