<commit_before># -*- coding: utf-8 -*-
"""
    pygments.lexers.dotnet
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for .net languages.

    :copyright: 2006 by <NAME>, <NAME>.
    :license: BSD, see LICENSE for more details.
"""
import re

from pygments.lexer import RegexLexer, bygroups, using, this
from pygments.token import Punctuation, \
     Text, Comment, Operator, Keyword, Name, String, Number, Literal

__all__ = ['CSharpLexer', 'BooLexer', 'VbNetLexer']


class CSharpLexer(RegexLexer):
    """
    For `C# <http://msdn2.microsoft.com/en-us/vcsharp/default.aspx>`_
    source code.
    """

    name = 'C#'
    aliases = ['csharp', 'c#']
    filenames = ['*.cs']
    mimetypes = ['text/x-csharp'] # inferred

    flags = re.MULTILINE | re.DOTALL

    tokens = {
        'root': [
            # method names
            (r'^([ \t]*(?:[a-zA-Z_][a-zA-Z0-9_\.]*\s+)+?)' # return arguments
             r'([a-zA-Z_][a-zA-Z0-9_]*)'                   # method name
             r'(\s*\([^;]*?\))'                            # signature
             r'(?=(?:\s|//.*?\n|/[*].*?[*]/)+\{)',         # lookahead for {
             bygroups(using(this), Name.Function, using(this))),
            (r'^\s*\[.*?\]', Name.Attribute),
            (r'[^\S\n]+', Text),
            (r'\\\n', Text), # line continuation
            (r'//.*?\n', Comment),
            (r'/[*](.|\n)*?[*]/', Comment),
            (r'\n', Text),
            (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation),
            (r'[{}]', Keyword),
            (r'@"(\\\\|\\"|[^"])*"', String),
            (r'"(\\\\|\\"|[^"\n])*["\n]', String),
            (r"'\\.'|'[^\\]'", String.Char),
            (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?"
             r"[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?", Number),
            (r'#[ \t]*(if|endif|else|elif|define|undef|'
             r'line|error|warning|region|endregion)\b.*?\n', Comment.Preproc),
            (r'(abstract|case|as|base|break|case|catch|'
             r'checked|const|continue|default|delegate|'
             r'do|else|enum|event|explicit|extern|false|finally|'
             r'fixed|for|foreach|goto|if|implicit|in|interface|'
             r'internal|is|lock|nwe|null|operator|'
             r'out|override|params|private|protected|public|readonly|'
             r'ref|return|sealed|sizeof|stackalloc|static|'
             r'switch|this|throw|true|try|typeof|'
             r'unchecked|unsafe|virtual|void|while|'
             r'get|set|new)\b', Keyword),
            (r'(bool|byte|char|decimal|double|float|int|long|object|sbyte|'
             r'short|string|uint|ulong|ushort)\b', Keyword.Type),
            (r'(class|struct)(\s+)', bygroups(Keyword, Text), 'class'),
            (r'(namespace|using)(\s+)', bygroups(Keyword, Text), 'namespace'),
            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
        ],
        'class': [
            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
        ],
        'namespace': [
            (r'(?=\()', Text, '#pop'), # using (resource)<commit_msg>[svn] added "partial" to csharp keyword list<commit_after># -*- coding: utf-8 -*-
"""
    pygments.lexers.dotnet
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for .net languages.

    :copyright: 2006 by <NAME>, <NAME>.
    :license: BSD, see LICENSE for more details.
"""
import re

from pygments.lexer import RegexLexer, bygroups, using, this
from pygments.token import Punctuation, \
     Text, Comment, Operator, Keyword, Name, String, Number, Literal

__all__ = ['CSharpLexer', 'BooLexer', 'VbNetLexer']


class CSharpLexer(RegexLexer):
    """
    For `C# <http://msdn2.microsoft.com/en-us/vcsharp/default.aspx>`_
    source code.
    """

    name = 'C#'
    aliases = ['csharp', 'c#']
    filenames = ['*.cs']
    mimetypes = ['text/x-csharp'] # inferred

    flags = re.MULTILINE | re.DOTALL

    tokens = {
        'root': [
            # method names
            (r'^([ \t]*(?:[a-zA-Z_][a-zA-Z0-9_\.]*\s+)+?)' # return arguments
             r'([a-zA-Z_][a-zA-Z0-9_]*)'                   # method name
             r'(\s*\([^;]*?\))'                            # signature
             r'(?=(?:\s|//.*?\n|/[*].*?[*]/)+\{)',         # lookahead for {
             bygroups(using(this), Name.Function, using(this))),
            (r'^\s*\[.*?\]', Name.Attribute),
            (r'[^\S\n]+', Text),
            (r'\\\n', Text), # line continuation
            (r'//.*?\n', Comment),
            (r'/[*](.|\n)*?[*]/', Comment),
            (r'\n', Text),
            (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation),
            (r'[{}]', Keyword),
            (r'@"(\\\\|\\"|[^"])*"', String),
            (r'"(\\\\|\\"|[^"\n])*["\n]', String),
            (r"'\\.'|'[^\\]'", String.Char),
            (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?"
             r"[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?", Number),
            (r'#[ \t]*(if|endif|else|elif|define|undef|'
             r'line|error|warning|region|endregion)\b.*?\n', Comment.Preproc),
            (r'(abstract|case|as|base|break|case|catch|'
             r'checked|const|continue|default|delegate|'
             r'do|else|enum|event|explicit|extern|false|finally|'
             r'fixed|for|foreach|goto|if|implicit|in|interface|'
             r'internal|is|lock|nwe|null|operator|'
             r'out|override|params|private|protected|public|readonly|'
             r'ref|return|sealed|sizeof|stackalloc|static|'
             r'switch|this|throw|true|try|typeof|partial|'
             r'unchecked|unsafe|virtual|void|while|'
             r'get|set|new)\b', Keyword),
            (r'(bool|byte|char|decimal|double|float|int|long|object|sbyte|'
             r'short|string|uint|ulong|ushort)\b', Keyword.Type),
            (r'(class|struct)(\s+)', bygroups(Keyword, Text), 'class'),
            (r'(namespace|using)(\s+)', bygroups(Keyword, Text), 'namespace'),
            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
        ],
        'class': [
            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
        ],
        'namespace': [
            (r'(?=\()', Text, '#pop'), # using (resource)
{'fraction_non_alphanumeric': 0.24846473029045643, 'fraction_numerical': 0.007634854771784232, 'mean_word_length': 2.163254593175853, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4006881', 'n_tokens_mistral': 2298, 'n_tokens_neox': 2170, 'n_words': 303}