diff options
author | Georg Brandl <georg@python.org> | 2022-10-27 08:29:41 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2022-10-27 11:58:29 +0200 |
commit | cffc5df62c258ca39fc7474f7197f2df33ab014f (patch) | |
tree | aff878367d037e4f7d4d032fadf32f0845e103b3 /pygments/lexers/python.py | |
parent | 11dac32db5db1166b8d55dc85bc16d2085936c9a (diff) | |
download | pygments-git-cffc5df62c258ca39fc7474f7197f2df33ab014f.tar.gz |
all: move often-used "line_re" to pygments.lexer
Diffstat (limited to 'pygments/lexers/python.py')
-rw-r--r-- | pygments/lexers/python.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py index 6bd74a1e..b959525a 100644 --- a/pygments/lexers/python.py +++ b/pygments/lexers/python.py @@ -12,7 +12,7 @@ import re import keyword from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \ - default, words, combined, do_insertions, this + default, words, combined, do_insertions, this, line_re from pygments.util import get_bool_opt, shebang_matches from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ Number, Punctuation, Generic, Other, Error @@ -22,8 +22,6 @@ __all__ = ['PythonLexer', 'PythonConsoleLexer', 'PythonTracebackLexer', 'Python2Lexer', 'Python2TracebackLexer', 'CythonLexer', 'DgLexer', 'NumPyLexer'] -line_re = re.compile('.*?\n') - class PythonLexer(RegexLexer): """ |