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

    Lexer for the Chapel language.

    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

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

__all__ = ['ChapelLexer']


class ChapelLexer(RegexLexer):
    """
    For `Chapel <http://chapel.cray.com/>`_ source.

    .. versionadded:: 2.0
    """
    name = 'Chapel'
    filenames = ['*.chpl']
    aliases = ['chapel', 'chpl']
    # mimetypes = ['text/x-chapel']

    tokens = {
        'root': [
            (r'\n', Text),
            (r'\s+', Text),
            (r'\\\n', Text),

            (r'//(.*?)\n', Comment.Single),
            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),

            (r'(config|const|in|inout|out|param|ref|type|var)\b',
             Keyword.Declaration),
            (r'(false|nil|true)\b', Keyword.Constant),
            (r'(bool|complex|imag|int|opaque|range|real|string|uint)\b',
             Keyword.Type),
            (words((
                'align', 'as', 'atomic', 'begin', 'break', 'by', 'catch',
                'cobegin',
                'coforall', 'continue', 'delete', 'dmapped', 'do', 'domain',
                'else', 'enum', 'except', 'export', 'extern', 'for', 'forall',
                'if', 'index', 'inline', 'label', 'lambda', 'let',
                'local', 'new', 'noinit', 'on', 'only', 'otherwise', 'pragma',
                'private', 'prototype',
                'public', 'reduce', 'require', 'return', 'scan',
                'select', 'serial', 'single', 'sparse', 'subdomain', 'sync',
                'then', 'throw', 'throws', 'try',
                'use', 'when', 'where', 'while', 'with', 'yield',
                'zip'), suffix=r'\b'),
             Keyword),
            (r'(iter)((?:\s)+)', bygroups(Keyword, Text), 'procname'),
            (r'(proc)((?:\s)+)', bygroups(Keyword, Text), 'procname'),
            (r'(class|module|record|union)(\s+)', bygroups(Keyword, Text),
             'classname'),

            # imaginary integers<commit_msg>Keywords grouped by starting letter<commit_after># -*- coding: utf-8 -*-
"""
    pygments.lexers.chapel
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexer for the Chapel language.

    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

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

__all__ = ['ChapelLexer']


class ChapelLexer(RegexLexer):
    """
    For `Chapel <http://chapel.cray.com/>`_ source.

    .. versionadded:: 2.0
    """
    name = 'Chapel'
    filenames = ['*.chpl']
    aliases = ['chapel', 'chpl']
    # mimetypes = ['text/x-chapel']

    tokens = {
        'root': [
            (r'\n', Text),
            (r'\s+', Text),
            (r'\\\n', Text),

            (r'//(.*?)\n', Comment.Single),
            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),

            (r'(config|const|in|inout|out|param|ref|type|var)\b',
             Keyword.Declaration),
            (r'(false|nil|true)\b', Keyword.Constant),
            (r'(bool|complex|imag|int|opaque|range|real|string|uint)\b',
             Keyword.Type),
            (words((
                'align', 'as', 'atomic',
                'begin', 'break', 'by',
                'catch', 'cobegin', 'coforall', 'continue',
                'delete', 'dmapped', 'do', 'domain',
                'else', 'enum', 'except', 'export', 'extern',
                'for', 'forall',
                'if', 'index', 'inline',
                'label', 'lambda', 'let', 'local',
                'new', 'noinit',
                'on', 'only', 'otherwise',
                'pragma', 'private', 'prototype', 'public',
                'reduce', 'require', 'return',
                'scan', 'select', 'serial', 'single', 'sparse', 'subdomain', 'sync',
                'then', 'throw', 'throws', 'try',
                'use',
                'when', 'where', 'while', 'with',
                'yield',
                'zip'), suffix=r'\b'),
             Keyword),
            (r'(iter)((?:\s)+)', bygroups(Keyword, Text), 'procname'),
            (r'(proc)((?:\s)+)', bygroups(Keyword, Text), 'procname'),
            (r'(class|module|record|union)(\s+)', bygroups(Keyword, Text),
             'classname'),

            # imaginary integers
{'fraction_non_alphanumeric': 0.21676802780191137, 'fraction_numerical': 0.0047784535186794095, 'mean_word_length': 2.0396039603960396, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2234455', 'n_tokens_mistral': 1529, 'n_tokens_neox': 1421, 'n_words': 309}