403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.139.237.30
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/mako/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/mako/__pycache__/lexer.cpython-37.pyc
B

�C]B�@s\dZddlZddlZddlmZddlmZddlmZddlmZiZ	Gdd�de
�ZdS)	zGprovides the Lexer class for parsing template strings into parse trees.�N)�compat)�
exceptions)�	parsetree)�adjust_whitespacec@s�eZdZd$dd�Zedd��Zd%dd�Zd	d
�Zdd�Zd
d�Z	e
�d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)&�LexerNFcCs�||_||_t�|j�|_d|_d|_d|_d|_g|_	g|_
g|_||_||_
tjrd|rdt�d��|dkrtg|_nt|d�s�|g|_n||_dS)N�rz4Mako for Python 3 does not support disabling Unicode�__iter__)�text�filenamerZTemplateNode�template�matched_lineno�matched_charpos�lineno�match_position�tag�control_line�
ternary_stack�disable_unicode�encodingrZpy3krZUnsupportedError�preprocessor�hasattr)�selfr	r
rZinput_encodingr�r�;/opt/alt/python37/lib/python3.7/site-packages/mako/lexer.py�__init__s(


zLexer.__init__cCs|j|j|j|jd�S)N)�sourcer�posr
)r	rr
r
)rrrr�exception_kwargs6szLexer.exception_kwargscCsXyt||f}Wn<tk
rL|r2t�||�}n
t�|�}|t||f<YnX|�|�S)z>compile the given regexp, cache the reg, and call match_reg().)�
_regexp_cache�KeyError�re�compile�	match_reg)rZregexp�flags�regrrr�match?s
zLexer.matchcCs�|j}|�|j|j�}|r�|��\}}||kr:|d|_n||_|j|_t�d|j||j��}|d}x,|dkr�||jkr�|j|dkr�|d8}qjW|||_	|jt
|�7_|S)z�match the given regular expression object to the current text
        position.

        if a match occurs, update the current text and line position.

        rz\nr�
)rr%r	�spanrrr �findall�
textlengthr
�len)rr$�mpr%�start�end�linesZcprrrr"Ms"
zLexer.match_regc	GsR|j}d�|�}d}d}d}�x.|�d�}|r0q |�dtj�}|rDq |�d|�}|r�|rr|dks�|dks�|dks�|j||jt|�d���|�d�fS|s�|�d|tj�}|�r0||�d��d�7}||�d��d	�8}||�d��d
�7}||�d��d�8}||�d��d�7}||�d��d
�8}q t	j
dd�|�f|j��q WdS)N�|rz#.*\nz+(\"\"\"|\'\'\'|\"|\')[^\\]*?(\\.[^\\]*?)*\1z(%s)rz(.*?)(?=\"|\'|#|%s)�{�}�(�)�[�]zExpected: %s�,)r�joinr%r �Sr	r*�group�countr�SyntaxExceptionr)	rZ
watch_nestingr	�startposZtext_reZbrace_levelZparen_levelZ
bracket_levelr%rrr�parse_until_textks@


zLexer.parse_until_textcOs�|�d|j�|�d|j�|�d|j�|j|d<|||�}t|j�r\|jdj�|�n|j	j�|�|j
r�|j
d}|j�|�t|tj
�r�|�|j�s�|jr�|jdr�|jddj�|�t|tj�r�t|j�r�|jd|_|j�|�n�t|tj
��r�|j�r |j
��|j��n�|j�rB|j
�|�|j�g�nl|j
�rp|j
d�|j��rp|jd�|�n>|j
�r�|j
d�|j��s�tjd|j|j
djff|j��dS)Nrrrr
���z1Keyword '%s' not a legal ternary for keyword '%s')�
setdefaultr	rr
r
r*rZnodes�appendrr�
isinstancer�ControlLineZ
is_ternary�keywordr�Tag�parent�isend�popZ
is_primaryrr;r)rZnodecls�args�kwargs�nodeZ
control_framerrr�append_node�sF







zLexer.append_nodez #.*coding[:=]\s*([-\w.]+).*\r?\nc
Cs&t|tj�r6|j�|�}|r&|�d�p,|p,d}||fS|�tj�r�|t	tj�d�}d}|j�|�
dd��}|dk	r�|�d�dkr�t�d|�d�|�
dd�dd|��n,|j�|�
dd��}|r�|�d�}n|p�d}|�ry|�
|�}Wn4t
k
�rt�d||�
dd�dd|��YnX||fS)	z�given string/unicode or bytes/string, determine encoding
           from magic encoding comment, return body as unicode
           or raw if decode_raw=False

        r�asciiNzutf-8�ignorezHFound utf-8 BOM in file, with conflicting magic encoding comment of '%s'rz0Unicode decode operation of encoding '%s' failed)rArZ	text_type�
_coding_rer%r9�
startswith�codecs�BOM_UTF8r*�decoder�CompileException�UnicodeDecodeError)rr	Z
decode_rawZknown_encodingr
�mrZparsed_encodingrrr�decode_raw_stream�s@


zLexer.decode_raw_streamcCs<|�|j|j|j|j�\|_|_x|jD]}||j�|_q*W|�|j�t|j�|_	xz|j
|j	krfP|��rpP|��rzqX|�
�r�qX|��r�qX|��r�qX|��r�qX|��r�qX|��r�qX|j
|j	kr�Pt�d��qXWt|j�r�tjd|jdjf|j��t|j��r6t�d|jdj|j|jdj|jdj|j��|jS)Nzassertion failedzUnclosed tag: <%%%s>r>z"Unterminated control keyword: '%s')rVr	rrr
rr"rNr*r)r�	match_end�match_expression�match_control_line�
match_comment�match_tag_start�
match_tag_end�match_python_block�
match_textrrSrr;rCrrrrr)rZpreprocrrr�parse�sR


zLexer.parsecCs�|�dtjtjBtjB�}|r�|��\}}}||_i}|rvx:t�d|�D]*}|\}}}	|p\|	}
|
�dd�}
|
||<qHW|�	t
j||�|r�|j�
�nR|dkr�|�dtj�}|s�tjd|jdjf|j��|�	t
j|�d	��|��Sd
SdSdS)Na+
            \<%     # opening tag

            ([\w\.\:]+)   # keyword

            ((?:\s+\w+|\s*=\s*|".*?"|'.*?')*)  # attrname, = \
                                               #        sign, string expression

            \s*     # more whitespace

            (/)?>   # closing

            z)\s*(\w+)\s*=\s*(?:'([^']*)'|\"([^\"]*)\")z
r&r	z(.*?)(?=\</%text>)zUnclosed tag: <%%%s>r>rTF)r%r �Ir8�X�groupsrCr(�replacerKrrDrrGrr;r�Textr9r\)rr%rC�attrrFZ
attributesZatt�keyZval1Zval2r	rrrr[)s6

zLexer.match_tag_startcCs�|�d�}|r~t|j�s4tjd|�d�f|j��n<|jdj|�d�krptjd|�d�|jdjff|j��|j��dSdSdS)Nz\</%[\t ]*(.+?)[\t ]*>z(Closing tag without opening tag: </%%%s>rr>z.Closing tag </%%%s> does not match tag: <%%%s>TF)	r%r*rrr;r9rrCrG)rr%rrrr\Xs



zLexer.match_tag_endcCs0|�dtj�}|r(|��}|r"|SdSndSdS)Nz\ZTF)r%r r8r9)rr%�stringrrrrWlszLexer.match_endcCs@|�dtjtjB�}|r8|�d�}|r4|�tj|�dSdSdS)Na�
                (.*?)         # anything, followed by:
                (
                 (?<=\n)(?=[ \t]*(?=%|\#\#)) # an eval or line-based
                                             # comment preceded by a
                                             # consumed newline and whitespace
                 |
                 (?=\${)      # an expression
                 |
                 (?=</?[%&])  # a substitution or block or call start or end
                              # - don't consume
                 |
                 (\\\r?\n)    # an escaped newline  - throw away
                 |
                 \Z           # end of string
                )rTF)r%r rar8r9rKrrd)rr%r	rrrr^ws
zLexer.match_textcCsd|�d�}|r\|j|j}}|�dd�\}}t|�d}|jtj||�d�dk||d�dSdSdS)	Nz<%(!)?Fz%>r&r�!)rrT)	r%rr
r=rrKrZCoder9)rr%�linerr	r-rrrr]�s
zLexer.match_python_blockcCs~|�d�}|rv|j|j}}|�ddd�\}}|dkrH|�dd�\}}nd}|�dd�}|jtj||��||d	�dSd
SdS)Nz\${Tz\|r1r/�z
r&)rrF)	r%rr
r=rcrKr�
Expression�strip)rr%rirr	r-ZescapesrrrrX�s 
zLexer.match_expressioncCs�|�dtj�}|r�|�d�}|�d�}|dkr�t�d|�}|sRtjd|f|j��|�dd�\}}|dk	}|r�t|j�s�tjd||ff|j��n0|jdj	|kr�tjd	||jdj	ff|j��|�
tj|||�n|�
tj
|�d
SdSdS)NzB(?<=^)[\t ]*(%(?!%)|##)[\t ]*((?:(?:\\r?\n)|[^\r\n])*)(?:\r?\n|\Z)r��%z(end)?(\w+)\s*(.*)zInvalid control line: '%s'z!No starting keyword '%s' for '%s'r>z'Keyword '%s' doesn't match keyword '%s'TF)r%r �Mr9rr;rr*rrCrKrrB�Comment)rr%�operatorr	�m2rFrCrrrrY�s:




zLexer.match_control_linecCs2|�dtj�}|r*|�tj|�d��dSdSdS)z*matches the multiline version of a commentz<%doc>(.*?)</%doc>rTFN)r%r r8rKrrpr9)rr%rrrrZ�s
zLexer.match_comment)NFNN)N)�__name__�
__module__�__qualname__r�propertyrr%r"r=rKr r!rNrVr_r[r\rWr^r]rXrYrZrrrrrs(
	
(/
.7/'r)�__doc__rPr �makorrrZ
mako.pygenrr�objectrrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit