7 Module implementing a custom lexer using pygments. |
7 Module implementing a custom lexer using pygments. |
8 """ |
8 """ |
9 |
9 |
10 import contextlib |
10 import contextlib |
11 |
11 |
|
12 from pygments.lexers import find_lexer_class, guess_lexer, guess_lexer_for_filename |
12 from pygments.token import Token |
13 from pygments.token import Token |
13 from pygments.lexers import guess_lexer_for_filename, guess_lexer, find_lexer_class |
|
14 from pygments.util import ClassNotFound |
14 from pygments.util import ClassNotFound |
15 |
|
16 from PyQt6.QtGui import QColor, QFont |
15 from PyQt6.QtGui import QColor, QFont |
17 |
16 |
|
17 from eric7 import Utilities |
18 from eric7.QScintilla.Lexers.LexerContainer import LexerContainer |
18 from eric7.QScintilla.Lexers.LexerContainer import LexerContainer |
19 |
|
20 from eric7 import Utilities |
|
21 |
19 |
22 PYGMENTS_DEFAULT = 0 |
20 PYGMENTS_DEFAULT = 0 |
23 PYGMENTS_COMMENT = 1 |
21 PYGMENTS_COMMENT = 1 |
24 PYGMENTS_PREPROCESSOR = 2 |
22 PYGMENTS_PREPROCESSOR = 2 |
25 PYGMENTS_KEYWORD = 3 |
23 PYGMENTS_KEYWORD = 3 |