HOME


Mini Shell 1.0
DIR: /usr/lib/python3/dist-packages/pygments/lexers/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/pygments/lexers/__pycache__/php.cpython-312.pyc
�

|�e�2����dZddlZddlmZmZmZmZmZmZm	Z	m
Z
mZmZddl
mZmZmZmZmZmZmZmZmZmZddlmZmZmZgd�ZGd�de�ZGd	�d
e�ZGd�de�Zy)
z�
    pygments.lexers.php
    ~~~~~~~~~~~~~~~~~~~

    Lexers for PHP and related languages.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)
�Lexer�
RegexLexer�include�bygroups�default�using�this�words�
do_insertions�line_re)
�Text�Comment�Operator�Keyword�Name�String�Number�Punctuation�Other�Generic)�get_bool_opt�get_list_opt�shebang_matches)�ZephirLexer�PsyshConsoleLexer�PhpLexerc�0�eZdZdZdZdZdgZdgZgd�Zgd�Z	e
je
jzZ
defd	ej fd
ej"fged�dej(d
fded
fed
�gded
fgdedfed�dedfdedfdefdedfdej2dfdej4fdej6fdej:fdej<fdej@fdejBfdejDfdejFfdej fgd �Z$y!)"rz�
    For Zephir language source code.

    Zephir is a compiled high level language aimed
    to the creation of C-extensions for PHP.

    .. versionadded:: 2.0
    �Zephirzhttp://zephir-lang.com/�zephirz*.zep)�fetch�echo�isset�empty)�bit�bits�string�\s+�//.*?\n�	/\*.*?\*/�commentsandwhitespacez3/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gim]+\b|\B)�#pop�/z\nz	^(?=\s|/)�slashstartsregexzC\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|(<<|>>>?|==?|!=?|->|[-<>+*%&|^/])=?z[{(\[;,]z[})\].]z�(for|in|while|do|break|return|continue|switch|case|default|if|else|loop|require|inline|throw|try|catch|finally|new|delete|typeof|instanceof|void|namespace|use|extends|this|fetch|isset|unset|echo|fetch|likely|unlikely|empty)\bz(var|let|with|function)\bz�(abstract|boolean|bool|char|class|const|double|enum|export|extends|final|native|goto|implements|import|int|string|interface|long|ulong|char|uchar|float|unsigned|private|protected|public|short|static|self|throws|reverse|transient|volatile|readonly)\bz(true|false|null|undefined)\bzm(Array|Boolean|Date|_REQUEST|_COOKIE|_SESSION|_GET|_POST|_SERVER|this|stdClass|range|count|iterator|window)\bz[$a-zA-Z_][\w\\]*z%[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?z0x[0-9a-fA-F]+z[0-9]+z"(\\\\|\\[^\\]|[^"\\])*"z'(\\\\|\\[^\\]|[^'\\])*')r*r-�badregex�rootN)%�__name__�
__module__�__qualname__�__doc__�name�url�aliases�	filenames�zephir_keywords�zephir_type�re�DOTALL�	MULTILINE�flagsr
r�Single�	Multilinerr�Regexrrrr�Declaration�Reserved�Constantr�Builtinrr�Float�Hex�Integer�Double�tokens���5/usr/lib/python3/dist-packages/pygments/lexers/php.pyrrs�����D�
#�C��j�G��	�I�9�O�+�K��I�I����$�E��T�N�
����(�
�7�,�,�-�"
�
�+�,��%�|�|�V�
5�
�8�V�$��F�O�
��D�&�!�
��4�!3�4��+�,�4�5=�?Q�
S�
�+�'9�:�
��%��"�#5�
7�*�7�+>�+>�@R�S�/�18�0@�0@�
B�.�w�/?�/?�@���<�<�
)�"�4�:�:�.�
5�v�|�|�D�
��
�
�+�
����'�
(�&�-�-�8�
(�&�-�-�8�3
�!+�FrKrc�*�eZdZdZdZdZdgZd�Zd�Zy)ru5
    For PsySH console output, such as:

    .. sourcecode:: psysh

        >>> $greeting = function($name): string {
        ...     return "Hello, {$name}";
        ... };
        => Closure($name): string {#2371 …3}
        >>> $greeting('World')
        => "Hello, World"

    .. versionadded:: 2.7
    zPsySH console session for PHPzhttps://psysh.org/�psyshc�:�d|d<tj|fi|��y)NT�startinline)r�__init__)�self�optionss  rLrQzPsyshConsoleLexer.__init__ks��!%��
��
���t�'�w�'rKc	#��K�tdi|j��}d}g}tj|�D�]}|j	�}|jd�s|jd�r:|j
t|�dtj|ddfgf�||ddz
}�p|j�dk(r7|j
t|�dtjdfgf�||ddz
}��|r't||j|��Ed{���d}g}|j�tj|f����|r$t||j|��Ed{���yy7�U7��w)	N�z>>> z... r�z...�rJ)rrSr�finditer�group�
startswith�append�lenr�Prompt�rstripr�get_tokens_unprocessed�start�Output)rR�text�phplexer�curcode�
insertions�match�lines       rLr_z(PsyshConsoleLexer.get_tokens_unprocessedosn�����+�d�l�l�+�����
��%�%�d�+�	:�E��;�;�=�D����v�&�$�/�/�&�*A��!�!�3�w�<�%&�����R�a��$A�#B�#D�E��4���8�#������%�'��!�!�3�w�<�%&�����$>�#?�#A�B��4���8�#���,�"�H�$C�$C�G�$L� N�N�N� �G�!#�J��k�k�m�W�^�^�T�9�9�!	:�"�$�Z�%-�%D�%D�W�%M�O�
O�
O��N��
O�s%�D	E%�E!�AE%�E#�E%�#E%N)	r0r1r2r3r4r5r6rQr_rJrKrLrrXs%��
�+�D�
�C��i�G�(�OrKrc��eZdZdZdZdZgd�Zgd�ZdgZdZ	dZ
ejejzejzZd	ej"d
fdefdefggd
ej"df�de
zdzeeeej*eej*ee�f�def�dedf�dej0f�dej0f�dej2f�dej4f�dej2f�de
zdzeeeej:�f�def�def�def�deeee�f�deee�d f�d!eee�f�d"eeeee�d#f�d$e	zdzeeeej>�f�d%ef�d&ej>f�e d'��d(ejBd)f�d*e	zejBf�e	ej$f�d+e"jFf�d,e"jFf�d-e"jHf�d.e"jJf�d/e"jLf�d0e"jNf�d1ej0f�d2ejPf�d3ejRd4f�d5ejBdfe d
�ge*d6d7�8�ejVjXfge*d9d7�8�ej>fge	ejZdfge d:�e	ejVdfe.d�gd3ejRdfd;ejRfd<ej^fd=e
zd>ze
zd?zej`fd@eej`e1e2dA�B�ej`�fdCeej`e1e2dA�B�ej`�fdDeej`ejBej`�fdEejRfgdFedfdGedHfe	ejffe d
�gdIedfe d
�gdJ�
Z4dK�Z5dL�Z6dM�Z7yN)Ora;
    For PHP source code.
    For PHP embedded in HTML, use the `HtmlPhpLexer`.

    Additional options accepted:

    `startinline`
        If given and ``True`` the lexer starts highlighting with
        php code (i.e.: no starting ``<?php`` required).  The default
        is ``False``.
    `funcnamehighlighting`
        If given and ``True``, highlight builtin function names
        (default: ``True``).
    `disabledmodules`
        If given, must be a list of module names whose function names
        should not be highlighted. By default all modules are highlighted
        except the special ``'unknown'`` module that includes functions
        that are known to php but are undocumented.

        To get a list of allowed modules have a look into the
        `_php_builtins` module:

        .. sourcecode:: pycon

            >>> from pygments.lexers._php_builtins import MODULES
            >>> MODULES.keys()
            ['PHP Options/Info', 'Zip', 'dba', ...]

        In fact the names of those modules match the module names from
        the php documentation.
    �PHPzhttps://www.php.net/)�php�php3�php4�php5)z*.phpz
*.php[345]z*.incz
text/x-phpz1(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*z+(?:[_a-z]|[^\x00-\x7f])(?:\w|[^\x00-\x7f])*z	<\?(php)?rjz[^<]+�<z\?>r+z(<<<)([\'"]?)(z)(\2\n.*?\n\s*)(\3)(;?)(\n)r'z#\[�	attributez#.*?\nr(z/\*\*/z/\*\*.*?\*/r)z
(->|::)(\s*)(�)z[~!%^&*+=|:.<>/@-]+z\?z
[\[\]{}();,]+z(new)(\s+)(class)\bz(class)(\s+)�	classnamez(function)(\s*)(?=\()z(function)(\s+)(&?)(\s*)�functionnamez
(const)(\s+)(a(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|FALSE|print|for|require|continue|foreach|require_once|declare|return|default|static|do|switch|die|stdClass|echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|virtual|endfor|include_once|while|endforeach|global|endif|list|endswitch|new|endwhile|not|array|E_ALL|NULL|final|php_user_filter|interface|implements|public|private|protected|abstract|clone|try|catch|throw|this|use|namespace|trait|yield|finally|match)\bz(true|false|null)\b�magicconstantsz\$\{�variablevariablez\$+z"(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?z\d+e[+-]?[0-9]+z0[0-7]+z0x[a-f0-9]+z\d+z0b[01]+z'([^'\\]*(?:\\.[^'\\]*)*)'z`([^`\\]*(?:\\.[^`\\]*)*)`�"r&z\})�__construct�
__destruct�__call�__callStatic�__get�__set�__isset�__unset�__sleep�__wakeup�
__toString�__invoke�__set_state�__clone�__debugInfoz\b)�suffix)�__LINE__�__FILE__�__DIR__�__FUNCTION__�	__CLASS__�	__TRAIT__�
__METHOD__�
__NAMESPACE__�
magicfuncsz	[^{$"\\]+z'\\([nrt"$\\]|[0-7]{1,3}|x[0-9a-f]{1,2})z\$z(\[\S+?\]|->z)?z(\{\$\{)(.*?)(\}\})T)�_startinlinez(\{)(\$.*?)(\})z(\$\{)(\S+)(\})z[${\\]z\]z\(�attributeparamsz\))
r/rjrtr�rsrqrrr&ror�c��t|dd�|_t|ddg�|_t|dd�|_d|vr|jd�|_t
�|_|jrHdd	lm	}|j�D]/\}}||jvs�|jj|��1tj|fi|��y)
N�funcnamehighlightingT�disabledmodules�unknownrPFr�r)�MODULES)rr�rr�rP�pop�set�
_functions�pygments.lexers._php_builtinsr��items�updaterrQ)rRrSr��key�values     rLrQzPhpLexer.__init__)s���$0��+�T�%3��!�+��&��� 5���'����F����W�$�&�{�{�>�:�D���%����$�$�=�%�m�m�o�
2�
��U��d�2�2�2��O�O�*�*�5�1�
2�	���D�,�G�,rKc#�K�dg}|jr|jd�tj|||�D]C\}}}|tj
ur$||jvr|tj|f���=|||f���Ey�w)Nr/rj)rPr[rr_rrr�rD)rRrb�stack�index�tokenr�s      rLr_zPhpLexer.get_tokens_unprocessed=s������������L�L����1�1�$��e�D�	&��E�5�%���
�
�"��D�O�O�+�����u�4�4�����%�%�
	&�s�A?Bc�Z�t|d�ryd}tjd|�r|dz
}|S)NrjTgz
<\?(?!xml)g333333�?)rr:�search)rb�rvs  rL�analyse_textzPhpLexer.analyse_textIs0���4��(��
��
�9�9�]�D�)��#�I�B��	rKN)8r0r1r2r3r4r5r6r7�	mimetypes�_ident_inner�_ident_nonsr:�
IGNORECASEr;r<r=r�Preprocrrr�	Delimiterrr
r>r?�Docrr�	AttributerrCr�VariablerrE�OctrFrG�Bin�BacktickrHr
�Function�Magic�Classr�Escape�Interpolrr	�	DecoratorrIrQr_r�rJrKrLrr�sH���@�D�
 �C�-�G�0�I���I�H�L�@�K��M�M�B�I�I�%����4�E��7�?�?�E�2�
�u��
�5�M�
�
3
�
�W�_�_�f�-�3
�
��
,�/M�
M�
�f�f�f�&6�&6���@P�@P�!�4�)�
*�3
�
�T�N�3
��[�+�.�
3
�����'�3
�����(�3
���)�)�*�3
��V�Z�Z�(�3
��7�,�,�-�3
���
+�c�
1�
�h��d�n�n�
5�
7�3
� $�X�.�!3
�"�H��#3
�$�{�+�%3
�&$�X�g�t�W�%E�F�'3
�(�h�w��5�{�C�)3
�*&�x���'>�?�+3
�,)�
�g�t�X�t�
4�n�
F�-3
�0��
,�s�
2�
�g�t�T�]�]�
3�
5�13
�4
!�#*�

+�53
�J$�W�%5�%5�6�K3
�L
�$�%�M3
�N�d�m�m�%7�8�O3
�P�l�
"�D�M�M�2�Q3
�R�4�:�:�&�S3
�T3�F�L�L�A�U3
�V ����.�W3
�X����$�Y3
�Z�V�Z�Z�(�[3
�\�V�^�^�$�]3
�^����$�_3
�`+�F�M�M�:�a3
�b+�F�O�O�<�c3
�d�6�=�=�(�+�e3
�j�D�M�M�6�*��E�N�
��:�CH�I��]�]�
 �
 �	
"�
��=����]�]�	
�
��4�:�:�v�.�
�
�L�!�
�4�=�=�&�1��F�O�
��6�=�=�&�)�
�6�=�=�)�
7����G�
�[�
 �?�
2�[�
@�4�
G�
�_�_�
�
#�
�f�o�o�u�T��'E��o�o�'�
(� �
�f�o�o�u�T��'E��o�o�'�
(� �
�f�o�o�t�}�}�f�o�o�
F�
H�
��
�
�&�
�"�K��(�
�K�!2�3�
�4�>�>�*��E�N�	
��K��(��E�N�
�Yp�F�d-�(
&�rKr) r3r:�pygments.lexerrrrrrrr	r
rr�pygments.tokenr
rrrrrrrrr�
pygments.utilrrr�__all__rrrrJrKrL�<module>r�sb���
�/�/�/�(�(�(�E�E�
:��?�*�?�D.O��.O�bF�z�FrK