diff options
author | Yuya Nishihara <yuya@tcha.org> | 2012-07-18 22:51:19 +0900 |
---|---|---|
committer | Yuya Nishihara <yuya@tcha.org> | 2012-07-18 22:51:19 +0900 |
commit | 8014741aa9e3dc21052f5d534fd2028d6489c4ee (patch) | |
tree | e23fa0125a1823b8ed5fc5a2b206bc4e487f5d7e | |
parent | e2ea98f0f72ca05e55b234b2a6dd548692818ac2 (diff) | |
download | pygments-8014741aa9e3dc21052f5d534fd2028d6489c4ee.tar.gz |
Closes #791: CSharp: remove unneeded "|\n" from Comment.Multiline pattern
Because CSharpLexer enables re.DOTALL flag, "." also matches "\n".
"(.|\n)" slows down matching speed significantly.
-rw-r--r-- | pygments/lexers/dotnet.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py index 890d46d9..0a2770ca 100644 --- a/pygments/lexers/dotnet.py +++ b/pygments/lexers/dotnet.py @@ -88,7 +88,7 @@ class CSharpLexer(RegexLexer): (r'[^\S\n]+', Text), (r'\\\n', Text), # line continuation (r'//.*?\n', Comment.Single), - (r'/[*](.|\n)*?[*]/', Comment.Multiline), + (r'/[*].*?[*]/', Comment.Multiline), (r'\n', Text), (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation), (r'[{}]', Punctuation), |