https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/utils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/utils/__pycache__/jslex.cpython-310.pyc
o

3�a�@sNdZddlZGdd�d�Zddd�ZGdd	�d	�ZGd
d�de�Zdd
�ZdS)zJsLex: a lexer for Javascript�Nc@seZdZdZdZddd�ZdS)�Tokz,
    A specification for a token class.
    rNcCs,tj|_tjd7_||_||_||_dS)N�)r�num�id�name�regex�next)�selfrrr�r
�4/usr/lib/python3/dist-packages/django/utils/jslex.py�__init__s

zTok.__init__�N)�__name__�
__module__�__qualname__�__doc__rrr
r
r
rrsr�csd���fdd�|��D��S)z�
    Create a regex from a space-separated list of literal `choices`.

    If provided, `prefix` and `suffix` will be attached to each choice
    individually.
    �|c3s"�|]}�t�|��VqdSr
)�re�escape)�.0�c��prefix�suffixr
r�	<genexpr>s� zliterals.<locals>.<genexpr>)�join�split)�choicesrrr
rr�literalssrc@s eZdZdZdd�Zdd�ZdS)�Lexerz2
    A generic multi-state regex-based lexer.
    cCs~i|_i|_|��D]/\}}g}|D]}d|j}||j|<|�d||jf�qt�d�|�tj	tj
B�|j|<q
||_dS)Nzt%dz
(?P<%s>%s)r)�regexes�toks�itemsr�appendrr�compiler�	MULTILINE�VERBOSE�state)r	�states�firstr(�rules�parts�tok�groupidr
r
rr#s

"
zLexer.__init__ccs��t|�}|j}|j}|j}d}||krB||�||�D]!}|j}||}	||}
|t|
�7}|	j|
fV|	jr=|	j}nq||ks||_dS)zW
        Lexically analyze `text`.

        Yield pairs (`name`, `tokentext`).
        rN)�lenr(r!r"�finditer�	lastgrouprr)r	�text�endr(r!r"�start�matchrr-�toktextr
r
r�lex1s&���
z	Lexer.lexN)rrrrrr7r
r
r
rr sr cseZdZdZedd�edd�edd�eded	d
d�dd
�ededd
d�dd
�edddd
�edddd
�edd�edddd
�eded�dd
�eded�dd
�eded�dd
�edddd
�edddd
�gZed d!�gZeeded"�dd
�geeed#d$dd
�ged%�Z�fd&d'�Z	�Z
S)(�JsLexerz�
    A Javascript lexer

    >>> lexer = JsLexer()
    >>> list(lexer.lex("a = 1"))
    [('id', 'a'), ('ws', ' '), ('punct', '='), ('ws', ' '), ('dnum', '1')]

    This doesn't properly handle non-ASCII characters in the Javascript source.
    �commentz/\*(.|\n)*?\*/�linecommentz//.*?$�wsz\s+�keywordal
                           break case catch class const continue debugger
                           default delete do else enum export extends
                           finally for function if import in instanceof
                           new return super switch this throw try typeof
                           var void while with
                           z\b)r�reg)r�reservedznull true false�divrz�
                  ([a-zA-Z_$   ]|\\u[0-9a-fA-Z]{4})   # first char
                  ([a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*  # rest chars
                  �hnumz0[xX][0-9a-fA-F]+�onumz0[0-7]+�dnuma|
                    (   (0|[1-9][0-9]*)     # DecimalIntegerLiteral
                        \.                  # dot
                        [0-9]*              # DecimalDigits-opt
                        ([eE][-+]?[0-9]+)?  # ExponentPart-opt
                    |
                        \.                  # dot
                        [0-9]+              # DecimalDigits
                        ([eE][-+]?[0-9]+)?  # ExponentPart-opt
                    |
                        (0|[1-9][0-9]*)     # DecimalIntegerLiteral
                        ([eE][-+]?[0-9]+)?  # ExponentPart-opt
                    )
                    �punctz�
                         >>>= === !== >>> <<= >>= <= >= == != << >> &&
                         || += -= *= %= &= |= ^=
                         z	++ -- ) ]z){ } ( [ . ; , < > + - * % & | ^ ! ~ ? : =�stringz"([^"\\]|(\\(.|\n)))*?"z'([^'\\]|(\\(.|\n)))*?'�other�.z/= /ra�
                    /                       # opening slash
                    # First character is..
                    (   [^*\\/[]            # anything but * \ / or [
                    |   \\.                 # or an escape sequence
                    |   \[                  # or a class, which has
                            (   [^\]\\]     #   anything but \ or ]
                            |   \\.         #   or an escape sequence
                            )*              #   many times
                        \]
                    )
                    # Following characters are same, except for excluding a star
                    (   [^\\/[]             # anything but \ / or [
                    |   \\.                 # or an escape sequence
                    |   \[                  # or a class, which has
                            (   [^\]\\]     #   anything but \ or ]
                            |   \\.         #   or an escape sequence
                            )*              #   many times
                        \]
                    )*                      # many times
                    /                       # closing slash
                    [a-zA-Z0-9]*            # trailing flags
                )r?r=cst��|jd�dS)Nr=)�superrr))r	��	__class__r
rr�szJsLexer.__init__)rrrrrr�both_before�
both_afterr)r�
__classcell__r
r
rHrr8LsX���
�
��+�������#r8cCs�dd�}t�}g}|�|�D]5\}}|dkrd}n%|dkr4|�d�r3t�d||dd	��}d
|d
}n
|dkr>|�dd
�}|�|�qd�|�S)z�
    Convert the Javascript source `js` into something resembling C for
    xgettext.

    What actually happens is that all the regex literals are replaced with
    "REGEX".
    cSs|d}|dkr
dS|S)z1Used in a regex to properly escape double quotes.r�"z\"r
)�m�sr
r
r�
escape_quotes�sz-prepare_js_for_gettext.<locals>.escape_quotesrz"REGEX"rD�'z\\.|.r���rMr�\�Ur)r8r7�
startswithr�sub�replacer$r)�jsrP�lexerrrr-�gutsr
r
r�prepare_js_for_gettext�s
�
r[)rr)rrrrr r8r[r
r
r
r�<module>s

.m

https://t.me/RX1948 - 2025