From cffc5df62c258ca39fc7474f7197f2df33ab014f Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 27 Oct 2022 08:29:41 +0200 Subject: all: move often-used "line_re" to pygments.lexer --- pygments/lexers/javascript.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pygments/lexers/javascript.py') diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py index 864a9043..eed71f95 100644 --- a/pygments/lexers/javascript.py +++ b/pygments/lexers/javascript.py @@ -11,7 +11,7 @@ import re from pygments.lexer import bygroups, combined, default, do_insertions, include, \ - inherit, Lexer, RegexLexer, this, using, words + inherit, Lexer, RegexLexer, this, using, words, line_re from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ Number, Punctuation, Other, Generic, Whitespace from pygments.util import get_bool_opt @@ -29,7 +29,6 @@ JS_IDENT_PART = ('(?:[$' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', '\u200c\u200d]|\\\\u[a-fA-F0-9]{4})') JS_IDENT = JS_IDENT_START + '(?:' + JS_IDENT_PART + ')*' -line_re = re.compile('.*?\n') class JavascriptLexer(RegexLexer): """ -- cgit v1.2.1