diff options
author | Georg Brandl <georg@python.org> | 2022-10-22 21:15:34 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2022-10-22 21:27:45 +0200 |
commit | 50ed74d55b2869817c3bc9cdc9eea00223216372 (patch) | |
tree | ff733ba0477c4b89473fcdc72811d5263bd55dee | |
parent | d04935c24fd16b74a2b7fdb06f6c1f6eac861a84 (diff) | |
download | pygments-git-50ed74d55b2869817c3bc9cdc9eea00223216372.tar.gz |
dotnet: code style fixup
-rw-r--r-- | pygments/lexers/dotnet.py | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py index 17360dfd..de364918 100644 --- a/pygments/lexers/dotnet.py +++ b/pygments/lexers/dotnet.py @@ -12,7 +12,7 @@ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, \ using, this, default, words from pygments.token import Punctuation, Text, Comment, Operator, Keyword, \ - Name, String, Number, Literal, Other, Whitespace + Name, String, Number, Literal, Other, Whitespace from pygments.util import get_choice_opt from pygments import unistring as uni @@ -62,9 +62,9 @@ class CSharpLexer(RegexLexer): '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'), 'full': ('@?(?:_|[^' + - uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' - + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', - 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'), + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' + + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', + 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'), } tokens = {} @@ -78,7 +78,7 @@ class CSharpLexer(RegexLexer): r'(' + cs_ident + ')' # method name r'(\s*)(\()', # signature start bygroups(Whitespace, using(this), Name.Function, Whitespace, - Punctuation)), + Punctuation)), (r'^(\s*)(\[.*?\])', bygroups(Whitespace, Name.Attribute)), (r'[^\S\n]+', Whitespace), (r'(\\)(\n)', bygroups(Text, Whitespace)), # line continuation @@ -95,7 +95,7 @@ class CSharpLexer(RegexLexer): (r'(#)([ \t]*)(if|endif|else|elif|define|undef|' r'line|error|warning|region|endregion|pragma)\b(.*?)(\n)', bygroups(Comment.Preproc, Whitespace, Comment.Preproc, - Comment.Preproc, Whitespace)), + Comment.Preproc, Whitespace)), (r'\b(extern)(\s+)(alias)\b', bygroups(Keyword, Whitespace, Keyword)), (r'(abstract|as|async|await|base|break|by|case|catch|' @@ -178,9 +178,9 @@ class NemerleLexer(RegexLexer): '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'), 'full': ('@?(?:_|[^' + - uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' - + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', - 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'), + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' + + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', + 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'), } tokens = {} @@ -194,7 +194,7 @@ class NemerleLexer(RegexLexer): r'(' + cs_ident + ')' # method name r'(\s*)(\()', # signature start bygroups(Whitespace, using(this), Name.Function, Whitespace, \ - Punctuation)), + Punctuation)), (r'^(\s*)(\[.*?\])', bygroups(Whitespace, Name.Attribute)), (r'[^\S\n]+', Whitespace), (r'(\\)(\n)', bygroups(Text, Whitespace)), # line continuation @@ -207,8 +207,8 @@ class NemerleLexer(RegexLexer): 'splice-string2'), (r'<#', String, 'recursive-string'), - (r'(<\[)(\s*)(' + cs_ident + ':)?', bygroups(Keyword, - Whitespace, Keyword)), + (r'(<\[)(\s*)(' + cs_ident + ':)?', + bygroups(Keyword, Whitespace, Keyword)), (r'\]\>', Keyword), # quasiquotation only @@ -414,8 +414,9 @@ class VbNetLexer(RegexLexer): Comment.Preproc), (r'[(){}!#,.:]', Punctuation), (r'(Option)(\s+)(Strict|Explicit|Compare)(\s+)' - r'(On|Off|Binary|Text)', bygroups(Keyword.Declaration, Whitespace, - Keyword.Declaration, Whitespace, Keyword.Declaration)), + r'(On|Off|Binary|Text)', + bygroups(Keyword.Declaration, Whitespace, Keyword.Declaration, + Whitespace, Keyword.Declaration)), (words(( 'AddHandler', 'Alias', 'ByRef', 'ByVal', 'Call', 'Case', 'Catch', 'CBool', 'CByte', 'CChar', 'CDate', 'CDec', 'CDbl', @@ -567,7 +568,7 @@ class FSharpLexer(RegexLexer): """ name = 'F#' - url= 'https://fsharp.org/' + url = 'https://fsharp.org/' aliases = ['fsharp', 'f#'] filenames = ['*.fs', '*.fsi'] mimetypes = ['text/x-fsharp'] @@ -649,7 +650,7 @@ class FSharpLexer(RegexLexer): (r'\b(%s)\b' % '|'.join(primitives), Keyword.Type), (r'(#)([ \t]*)(if|endif|else|line|nowarn|light|\d+)\b(.*?)(\n)', bygroups(Comment.Preproc, Whitespace, Comment.Preproc, - Comment.Preproc, Whitespace)), + Comment.Preproc, Whitespace)), (r"[^\W\d][\w']*", Name), |