Skip to content

Commit b6a51ec

Browse files
committed
fix lua regex causing runaway backtracking.
Use negative lookahead to avoid runway backtracking in whitespace. Fixes #2839
1 parent edef94d commit b6a51ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pygments/lexers/scripting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class LuaLexer(RegexLexer):
5757

5858
_comment_multiline = r'(?:--\[(?P<level>=*)\[[\w\W]*?\](?P=level)\])'
5959
_comment_single = r'(?:--.*$)'
60-
_space = r'(?:\s+)'
60+
_space = r'(?:\s+(?!\s))'
6161
_s = rf'(?:{_comment_multiline}|{_comment_single}|{_space})'
6262
_name = r'(?:[^\W\d]\w*)'
6363

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy