<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">"""
    pygments.lexers.apl
    ~~~~~~~~~~~~~~~~~~~

    Lexers for APL.

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

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

__all__ = ['APLLexer']


class APLLexer(RegexLexer):
    """
    A simple APL lexer.

    .. versionadded:: 2.0
    """
    name = 'APL'
    url = 'https://en.m.wikipedia.org/wiki/APL_(programming_language)'
    aliases = ['apl']
    filenames = [
        '*.apl', '*.aplf', '*.aplo', '*.apln',  
        '*.aplc', '*.apli', '*.dyalog',
    ]

    tokens = {
        'root': [
            # Whitespace
            # ==========
            (r'\s+', Whitespace),
            #
            # Comment
            # =======
            # 'â' is traditional; '#' is supported by GNU APL and NGN (but not Dyalog)
            (r'[â#].*$', Comment.Single),
            #
            # Strings
            # =======
            (r'\'((\'\')|[^\'])*\'', String.Single),
            (r'"(("")|[^"])*"', String.Double),  # supported by NGN APL
            #
            # Punctuation
            # ===========
            # This token type is used for diamond and parenthesis
            # but not for bracket and ; (see below)
            (r'[â‹„â—‡()]', Punctuation),
            #
            # Array indexing
            # ==============
            # Since this token type is very important in APL, it is not included in
            # the punctuation token type but rather in the following one
            (r'[\[\];]', String.Regex),
            #
            # Distinguished names
            # ===================
            # following IBM APL2 standard
            (r'âŽ•[A-Za-zÎ”âˆ†â™][A-Za-zÎ”âˆ†â™_Â¯0-9]*', Name.Function),
            #
            # Labels
            # ======
            # following IBM APL2 standard
            # (r'[A-Za-zÎ”âˆ†â™][A-Za-zÎ”âˆ†â™_Â¯0-9]*:', Name.Label),
            #
            # Variables
            # =========
            # following IBM APL2 standard (with a leading _ ok for GNU APL and Dyalog)
            (r'[A-Za-zÎ”âˆ†â™_][A-Za-zÎ”âˆ†â™_Â¯0-9]*', Name.Variable),     
            #
            # Numbers
            # =======
            (r'Â¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+Â¯]?[0-9]+)?|Â¯|âˆž)'
             r'([Jj]Â¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+Â¯]?[0-9]+)?|Â¯|âˆž))?',
             Number),
            #
            # Operators
            # ==========
            (r'[\.\\\/âŒ¿â€Â¨â£â¨â&nbsp;â¤âˆ˜âŒ¸&amp;âŒ¶@âŒºâ¥â›â¢]', Name.Attribute),  # closest token type
            (r'[+\-Ã—Ã·âŒˆâŒŠâˆ£|â³?*âŸâ—‹!âŒ¹&lt;â‰¤=&gt;â‰¥â‰&nbsp;â‰¡â‰¢âˆŠâ·âˆªâˆ©~âˆ¨âˆ§â±â²â´,âªâŒ½âŠ–â‰â†‘â†“âŠ‚âŠƒâŒ·â‹â’âŠ¤âŠ¥â•âŽâŠ£âŠ¢ââ‚â‰ˆâŒ¸â¯â†—âŠ†âŠ‡â¸âˆšâŒ¾â€¦â®]',
             Operator),
            #
            # Constant
            # ========
            (r'â¬', Name.Constant),
            #
            # Quad symbol
            # ===========
            (r'[âŽ•âž]', Name.Variable.Global),
            #
            # Arrows left/right
            # =================
            (r'[â†â†’]', Keyword.Declaration),
            #
            # D-Fn
            # ====
            (r'[âºâµâ¶â¹âˆ‡:]', Name.Builtin.Pseudo),
            (r'[{}]', Keyword.Type),
        ],
    }
</pre></body></html>