Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/jinja2/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/jinja2/__pycache__/parser.cpython-310.pyc
o

�˝`W��@s�UdZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ejr6ddlZ
dd	lmZe�d
ejej�Ze�dejej�Zegd��Zegd
��Zejejejejejejd�Z ej!e"ej#ej$fe%d<Gdd�d�Z&dS)z8Parse tokens from the lexer into nodes for the compiler.�N�)�nodes)�TemplateAssertionError)�TemplateSyntaxError)�describe_token)�describe_token_expr)�Environment�_ImportInclude�
_MacroCall)�for�if�block�extends�print�macro�include�from�import�set�with�
autoescape)�eq�ne�lt�lteq�gt�gteq)�add�sub�mul�div�floordiv�mod�_math_nodesc@s�eZdZdZ			d�dddedejedejedejed	dfd
d�Zdefded
eje	dej
ed	dfdd�Zdejedejej
edfd
eje	d	dfdd�Z	d�ded
eje	d	dfdd�Z		d�dejej
edfd
eje	d	dfdd�Z	d�dejej
edfd	efdd�Zd�d
eje	d	ejfdd�Zd	ejejejejffd d!�Z	"d�dej
edfd#ed	ejejfd$d%�Zd	ejejejffd&d'�Zd	ejfd(d)�Zd	ejfd*d+�Z d	ej!fd,d-�Z"d	ej#fd.d/�Z$d	ej%fd0d1�Z&d	ej'fd2d3�Z(d4e)d5ed	e)fd6d7�Z*d	ej+fd8d9�Z,d	ej-fd:d;�Z.d	ej/fd<d=�Z0d4e1d	dfd>d?�Z2d	ej3fd@dA�Z4d	ej5fdBdC�Z6d	ej7fdDdE�Z8d	ej9fdFdG�Z:e;j<	d�dHedIdJd	ej=fdKdL��Z>e;j<	M	"		"d�dHedIedejej
edfdNed	ejej?ej=ej
ff
dOdL��Z>	M	"		"d�dHedIedejej
edfdNed	ejej?ej=ej
ff
dPdL�Z>d�dQed	ej@fdRdS�ZAd	ej@fdTdU�ZBd	ej@fdVdW�ZCd	ej@fdXdY�ZDd	ej@fdZd[�ZEd	ej@fd\d]�ZFd	ej@fd^d_�ZGd	ej@fd`da�ZHd	ej@fdbdc�ZId	ej@fddde�ZJd�dfed	ej@fdgdh�ZKd	ej@fdidj�ZL	"	M		"d�dkedQedejej
edfdled	ejej
ej@ff
dmdn�ZMd	ejfdodp�ZNd	ejOfdqdr�ZPd4ej@d	ej@fdsdt�ZQd4ej@d	ej@fdudv�ZRd4ej@d	ejejSejTffdwdx�ZUd	ej@fdydz�ZVd	ej
fd{d|�ZWd4ej@d	ejXfd}d~�ZY	"d�d4ejej@ded	ejej@fd�d��ZZd4ej@d	ej@fd�d��Z[	d�dejej
edfd	ejejfd�d��Z\d	ej]fd�d��Z^dS)��Parserz�This is the central parsing class Jinja uses.  It's passed to
    extensions and can be used to parse expressions or statements.
    N�environmentr�source�name�filename�state�returncCsl||_|�||||�|_||_||_d|_i|_|��D]}|jD]}|j	|j|<q!qd|_
g|_g|_dS)NFr)
r%�	_tokenize�streamr'r(�closed�
extensions�iter_extensions�tags�parse�_last_identifier�
_tag_stack�_end_token_stack)�selfr%r&r'r(r)�	extension�tag�r8�//usr/lib/python3/dist-packages/jinja2/parser.py�__init__3s�
�
zParser.__init__�msg�lineno�exczte.NoReturncCs$|dur	|jjj}||||j|j��)z�Convenience method that raises `exc` with the message, passed
        line number or last line number as well as the current name and
        filename.
        N)r,�currentr<r'r()r5r;r<r=r8r8r9�failJs

zParser.fail�end_token_stack.cCs�t�}|D]
}|�tt|��q|r d�tttt|d���}nd}|dur*dg}nd|�d�g}|rN|durE||vrE|�d|�d��n	|�d|�d��|jr]|�d|jd�d��|�d	�|�|�dS)
Nz or ���zUnexpected end of template.zEncountered unknown tag �.z\You probably made a nesting mistake. Jinja is expecting this tag, but currently looking for z*Jinja was looking for the following tags: z/The innermost block that needs to be closed is � )	r�update�mapr�join�repr�appendr3r?)r5r'r@r<�expected�exprs�currently_looking�messager8r8r9�_fail_ut_eofXs8���
���zParser._fail_ut_eofcCs|�||j|�dS)z�Called if the parser encounters an unknown tag.  Tries to fail
        with a human readable error message that could help to identify
        the problem.
        N)rMr4)r5r'r<r8r8r9�fail_unknown_tag�szParser.fail_unknown_tag�
end_tokenscCs.t|j�}|dur|�|�|�d||�dS)z9Like fail_unknown_tag but for end of template situations.N)�listr4rHrM)r5rOr<�stackr8r8r9�fail_eof�s

zParser.fail_eof�extra_end_rulescCs,|jjjdvr	dS|dur|jj�|�SdS)zAre we at the end of a tuple?)�variable_end�	block_end�rparenTNF)r,r>�type�test_any)r5rSr8r8r9�is_tuple_end�s
zParser.is_tuple_endcCs8|jd7_t�tj�}tjj|d|j��|d�|S)zDReturn a new free identifier as :class:`~jinja2.nodes.InternalName`.r�fi�r<)r2�object�__new__r�InternalName�Noder:)r5r<�rvr8r8r9�free_identifier�szParser.free_identifiercCs,|jj}|jdkr|�d|j�|j�|j�d}zs|jtvr6t	|d|jjj���}|�W|r5|j�
�SS|jdkrH|��W|rG|j�
�SS|jdkrZ|��W|rY|j�
�SS|j
�|j�}|durr||�W|rq|j�
�SS|j�
�d}|�|j|j�W|r�|j�
�dSdS|r�|j�
�ww)	zParse a single statement.r'ztag name expectedT�parse_�call�filterNF)r,r>rWr?r<r3rH�value�_statement_keywords�getattr�pop�parse_call_block�parse_filter_blockr.�getrN)r5�token�pop_tag�f�extr8r8r9�parse_statement�sH

�
��
���	�
���zParser.parse_statementF�drop_needlecCsL|j�d�|j�d�|�|�}|jjjdkr|�|�|r$t|j�|S)aRParse multiple statements into a list until one of the end tokens
        is reached.  This is used to parse the body of statements as it also
        parses template data if appropriate.  The parser checks first if the
        current token is a colon and skips it if there is one.  Then it checks
        for the block end and parses until if one of the `end_tokens` is
        reached.  Per default the active token in the stream at the end of
        the call is the matched end token.  If this is not wanted `drop_needle`
        can be set to `True` and the end token is removed.
        �colonrU�eof)r,�skip_if�expect�subparser>rWrR�next)r5rOrq�resultr8r8r9�parse_statements�s



zParser.parse_statementscCsft|j�j}|jdd�}|j�d�r|��}tj|||d�S|�d�}|j	ddd�}tj
||||d�S)zParse an assign statement.T)�with_namespace�assignr[N)zname:endset�rq)rwr,r<�parse_assign_targetrt�parse_tupler�Assign�parse_filterry�AssignBlock)r5r<�target�expr�filter_node�bodyr8r8r9�	parse_set�s
zParser.parse_setc	Cs�|j�d�j}|jdd�}|j�d�|jddd�}d}|j�d	�r&|��}|j�d
�}|�d�}t|j�j	dkr<g}n|jd
dd�}t
j|||||||d�S)zParse a for loop.zname:for)�name:in)rSr�F)�name:recursive)�
with_condexprrSN�name:ifr�)�name:endfor�	name:else�endfor)r�Tr|r[)r,rur<r}r~rt�parse_expressionryrwrer�For)r5r<r��iter�test�	recursiver��else_r8r8r9�	parse_for�s�
zParser.parse_forcCs�tj|j�d�jd�}}	|jdd�|_|�d�|_g|_	g|_
t|j�}|�d�r;tj|jjjd�}|j	�
|�q
|�d�rH|jd	dd
�|_
	|S)zParse an if construct.r�r[TF�r�)�	name:elifr��
name:endifr�r�)r�r|)r�Ifr,rur<r~r�ryr��elif_r�rwr>rH)r5�noderxrlr8r8r9�parse_if�s


zParser.parse_ifcCs�tjt|j�jd�}g}g}|jjjdkr?|r|j�d�|��}|�	d�|�
|�|j�d�|�
|���|jjjdks||_||_
|jddd�|_|S)	Nr[rU�comma�paramr{)zname:endwithTr|)r�Withrwr,r<r>rWrur}�set_ctxrHr��targets�valuesryr�)r5r�r�r�r�r8r8r9�
parse_withs 

�zParser.parse_withcCsDtjt|j�jd�}t�d|���g|_|jddd�|_	t�
|g�S)Nr[r)zname:endautoescapeTr|)r�ScopedEvalContextModifierrwr,r<�Keywordr��optionsryr��Scope�r5r�r8r8r9�parse_autoescape szParser.parse_autoescapecCs�tjt|j�jd�}|j�d�j|_|j�d�|_	|j�d�|_
|jjjdkr,|�
d�|jddd	�|_|j
rFtd
d�|jD��sF|�
d�|j�d
|j�|S)Nr[r'zname:scopedz
name:requiredrzpBlock names in Jinja have to be valid Python identifiers and may not contain hyphens, use an underscore instead.)z
name:endblockTr|css2�|]}|jD]}t|tj�o|j��VqqdS�N)r�
isinstance�TemplateData�data�isspace)�.0r��childr8r8r9�	<genexpr>:s����z%Parser.parse_block.<locals>.<genexpr>z7Required blocks can only contain comments or whitespacezname:)r�Blockrwr,r<rurer'rt�scoped�requiredr>rWr?ryr��allr�r8r8r9�parse_block&s��
zParser.parse_blockcCs"tjt|j�jd�}|��|_|S�Nr[)r�Extendsrwr,r<r��templater�r8r8r9�
parse_extendsDs
zParser.parse_extendsr��defaultcCsJ|jj�dd�r |j���d�r t|j�jdk|_|j��|S||_|S)Nz	name:withzname:without�name:contextr)	r,r>rX�lookr�rwre�with_context�skip)r5r�r�r8r8r9�parse_import_contextIs��
�zParser.parse_import_contextcCsbtjt|j�jd�}|��|_|jj�d�r(|j�	��d�r(d|_
|j�d�nd|_
|�|d�S)Nr[zname:ignorezname:missingT�F)
r�Includerwr,r<r�r�r>r�r��ignore_missingr�r�r�r8r8r9�
parse_includeUs
�zParser.parse_includecCsFtjt|j�jd�}|��|_|j�d�|jdd�j	|_
|�|d�S)Nr[�name:asT��	name_onlyF)r�Importrwr,r<r�r�rur}r'r�r�r�r8r8r9�parse_importas

zParser.parse_importcstjt�j�jd������_�j�d�g�_dt	f��fdd�}	�jr,�j�d��jj
jdkrv|�r7nF�jdd	�}|j
�d
�rL�jd|jtd��j�d
�rc�jdd	�}�j�|j
|j
f�n�j�|j
�|�st�jj
jdkrunn�j�d�q#t�d�s�d�_�S)Nr[zname:importr*csB�jjjdvr�j���d�rt�j�jdk�_�j��dSdS)N>r�withoutr�rTF)r,r>rer�r�rwr�r�r8�r�r5r8r9�
parse_contextns��
z(Parser.parse_from.<locals>.parse_contextTr�r'r��_z4names starting with an underline can not be imported)r=r�r�F)r�
FromImportrwr,r<r�r�ru�names�boolr>rWr}r'�
startswithr?rrtrH�hasattrr�)r5r�r��aliasr8r�r9�
parse_fromhs<
���
zParser.parse_fromcCs�g}|_g}|_|j�d�|jjjdkrK|r|j�d�|jdd�}|�d�|j�d�r8|�	|�
��n|r?|�d�|�	|�|jjjdks|j�d�dS)	N�lparenrVr�Tr�r�r{z-non-default argument follows default argument)�args�defaultsr,rur>rWr}r�rtrHr�r?)r5r�r�r��argr8r8r9�parse_signature�s




�
zParser.parse_signaturecCsvtjt|j�jd�}|jjjdkr|�|�ng|_g|_	|�
�}t|tj�s.|�
d|j�||_|jddd�|_|S)Nr[r�z
expected call)zname:endcallTr|)r�	CallBlockrwr,r<r>rWr�r�r�r�r��Callr?rcryr�)r5r��	call_noder8r8r9ri�szParser.parse_call_blockcCs8tjt|j�jd�}|jddd�|_|jddd�|_|S)Nr[T)�start_inline)zname:endfilterr|)	r�FilterBlockrwr,r<r�rdryr�r�r8r8r9rj�szParser.parse_filter_blockcCsBtjt|j�jd�}|jdd�j|_|�|�|jddd�|_	|S)Nr[Tr�)z
name:endmacror|)
r�Macrorwr,r<r}r'r�ryr�r�r8r8r9�parse_macro�s

zParser.parse_macrocCs\tjt|j�jd�}g|_|jjjdkr,|jr|j�d�|j�|�	��|jjjdks|S)Nr[rUr�)
r�Outputrwr,r<r>rWrurHr�r�r8r8r9�parse_print�s�zParser.parse_print�
with_tupler�zte.Literal[True]cC�dSr�r8)r5r�r�r8r8r9r}�szParser.parse_assign_targetTrzcCr�r�r8)r5r�r�rSrzr8r8r9r}�scCs�|r'|j��jdkr'|j�d�}t|j�|j�d�}tj|j|j|jd�}n&|r:|j�d�}tj	|jd|jd�}n|rD|j
d|d�}n|��}|�d�|�
�s`|�dt|�j����|j�|S)aParse an assignment target.  As Jinja allows assignments to
        tuples, this function can parse all allowed assignment targets.  Per
        default assignments to tuples are parsed, that can be disable however
        by setting `with_tuple` to `False`.  If only assignments to names are
        wanted `name_only` can be set to `True`.  The `extra_end_rules`
        parameter is forwarded to the tuple parsing function.  If
        `with_namespace` is enabled, a namespace assignment may be parsed.
        �dotr'r[�storeT)�
simplifiedrSzcan't assign to )r,r�rWrurwr�NSRefrer<�Namer~�
parse_primaryr��
can_assignr?�__name__�lower)r5r�r�rSrzrl�attrr�r8r8r9r}�s&
�
�r�cCs|r|��S|��S)z�Parse an expression.  Per default all expressions are parsed, if
        the optional `with_condexpr` parameter is set to `False` conditional
        expressions are not parsed.
        )�parse_condexpr�parse_or)r5r�r8r8r9r�szParser.parse_expressioncCsl|jjj}|��}|j�d�r4|��}|j�d�r|��}nd}tj||||d�}|jjj}|j�d�s|S)Nr�r�r[)r,r>r<r�rtr�r�CondExpr)r5r<�expr1�expr2�expr3r8r8r9r�s


�zParser.parse_condexprcC�P|jjj}|��}|j�d�r&|��}tj|||d�}|jjj}|j�d�s|S)N�name:orr[)r,r>r<�	parse_andrtr�Or�r5r<�left�rightr8r8r9r��

�zParser.parse_orcCr�)N�name:andr[)r,r>r<�	parse_notrtr�Andr�r8r8r9r�&r�zParser.parse_andcCs4|jj�d�rt|j�j}tj|��|d�S|��S)N�name:notr[)	r,r>r�rwr<r�Notr��
parse_compare)r5r<r8r8r9r�/szParser.parse_notcCs�|jjj}|��}g}	|jjj}|tvr&t|j�|�t�	||����n4|j�
d�r8|�t�	d|����n"|jj�d�rY|j���d�rY|j�
d�|�t�	d|����nn|jjj}q|sd|Stj|||d�S)NTr��inr�r��notinr[)r,r>r<�parse_math1rW�_compare_operatorsrwrHr�Operandrtr�r�r��Compare)r5r<r��ops�
token_typer8r8r9r5s*


�
�zParser.parse_comparecC�j|jjj}|��}|jjjdvr3t|jjj}t|j�|��}||||d�}|jjj}|jjjdvs|S)N)rrr[)r,r>r<�parse_concatrWr#rw�r5r<r��clsr�r8r8r9rL�


�zParser.parse_math1cCsj|jjj}|��g}|jjjdkr$t|j�|�|���|jjjdkst|�dkr.|dStj	||d�S)N�tilderrr[)
r,r>r<�parse_math2rWrwrH�lenr�Concat)r5r<r�r8r8r9rWs


�zParser.parse_concatcCr
)N)rr r!r"r[)r,r>r<�	parse_powrWr#rwrr8r8r9rarzParser.parse_math2cCs^|jjj}|��}|jjjdkr-t|j�|��}tj|||d�}|jjj}|jjjdks|S)N�powr[)r,r>r<�parse_unaryrWrwr�Powr�r8r8r9rls


�zParser.parse_pow�with_filtercCs�|jjj}|jjj}|dkrt|j�tj|�d�|d�}n|dkr2t|j�tj|�d�|d�}n|�	�}|�
|�}|rB|�|�}|S)NrFr[r)r,r>rWr<rwr�Negr�Posr��
parse_postfix�parse_filter_expr)r5rr	r<r�r8r8r9rvs





zParser.parse_unarycCs�|jj}|jdkr9|jdvrtj|jdv|jd�}n|jdvr(tjd|jd�}n
tj|jd|jd�}t|j�|S|jdkrqt|j�|jg}|j}|jjjdkre|�	|jjj�t|j�|jjjdksQtjd�
|�|d�}|S|jd	vr�t|j�tj|j|jd�}|S|jd
kr�t|j�|jdd�}|j�d
�|S|jdkr�|�
�}|S|jdkr�|��}|S|�dt|���|j�|S)Nr')�true�false�True�False)rrr[)�none�None�load�string�)�integer�floatr�T)�explicit_parenthesesrV�lbracket�lbracezunexpected )r,r>rWrer�Constr<r�rwrHrFr~ru�
parse_list�
parse_dictr?r)r5rlr��bufr<r8r8r9r��sH




�

�
�

�

�
��zParser.parse_primaryr�r'c	s��jjj}|r�j}n|r�j}n
dtjf�fdd�}g}d}	|r(�j�d���|�r.n|�	|���jjj
dkr>d}nn�jjj}q |s[|rM|dS|s[��dt�jj����tj
|d	|d
�S)a�Works like `parse_expression` but if multiple expressions are
        delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created.
        This method could also return a regular expression instead of a tuple
        if no commas where found.

        The default parsing mode is a full tuple.  If `simplified` is `True`
        only names and literals are parsed.  The `no_condexpr` parameter is
        forwarded to :meth:`parse_expression`.

        Because tuples do not require delimiters and may end in a bogus comma
        an extra hint is needed that marks the end of a tuple.  For example
        for loops support tuples between `for` and `in`.  In that case the
        `extra_end_rules` is set to ``['name:in']``.

        `explicit_parentheses` is true if the parsing was triggered by an
        expression in parentheses.  This is used to figure out if an empty
        tuple is a valid expression or not.
        r*cs�jdd�S)NFr�)r�r8�r5r8r9r1�sz!Parser.parse_tuple.<locals>.parseFTr�rzExpected an expression, got r"r[)r,r>r<r�r�r�ExprrurYrHrWr?r�Tuple)	r5r�r�rSr'r<r1r��is_tupler8r.r9r~�s:


�
��zParser.parse_tuplecCsv|j�d�}g}|jjjdkr-|r|j�d�|jjjdkrn|�|���|jjjdks|j�d�tj||jd�S)Nr(�rbracketr�r[)	r,rur>rWrHr�r�Listr<)r5rl�itemsr8r8r9r+�s�zParser.parse_listcCs�|j�d�}g}|jjjdkr@|r|j�d�|jjjdkrn!|��}|j�d�|��}|�tj|||jd��|jjjdks|j�d�tj	||jd�S)Nr)�rbracer�rrr[)
r,rur>rWr�rHr�Pairr<�Dict)r5rlr4�keyrer8r8r9r,�s�	zParser.parse_dictcCsD	|jjj}|dks|dkr|�|�}n
|dkr|�|�}n	|Sq)NTr�r(r�)r,r>rW�parse_subscript�
parse_call�r5r�r	r8r8r9rs
�zParser.parse_postfixcCs^	|jjj}|dkr|�|�}n|dkr!|jjjdkr!|�|�}n
|dkr+|�|�}n	|Sq)NT�piper'�isr�)r,r>rWr�re�
parse_testr:r;r8r8r9rs
�zParser.parse_filter_exprcCs&t|j�}|jdkrB|jj}t|j�|jdkr#tj||jd|jd�S|jdkr/|�d|j�tj	|j|jd�}tj
||d|jd�S|jdkr�g}|jjjdkrf|rX|j�d	�|�|�
��|jjjdksP|j�d�t|�d
krw|d}n	tj|d|jd�}tj
||d|jd�S|�d|j�dS)
Nr�r'r"r[r%zexpected name or numberr(r2r�rrzexpected subscript expression)rwr,rWr>r�Getattrrer<r?r*�GetitemrurH�parse_subscribedrr0)r5r�rl�
attr_tokenr�r�r8r8r9r9#s2



�

�
zParser.parse_subscriptcCs�|jjj}|jjjdkrt|j�dg}n|��}|jjjdkr"|St|j�|g}|jjjdkr7|�d�n|jjjdvrF|�|���n|�d�|jjjdkrlt|j�|jjjdvrf|�|���n|�d�n|�d�tj|d|i�S)Nrr)r2r�r<)	r,r>r<rWrwr�rHr�Slice)r5r<r�r�r8r8r9rABs*





zParser.parse_subscribedc	s~�j�d��g}g}d}d}d}dtddf��fdd�}�jjjdkr�|r3�j�d��jjjdkr3n��jjjd	krN||duoB|du�t�j����}n\�jjjd
kre||du�t�j����}nE�jjjdkr��j��jdkr�||du��jjj}�j�	d
����}|�
tj|||j
d��n||duo�|duo�|�|�
����d}�jjjdks#�j�d�||||fS)Nr�Fr�r*cs|s��d�j�dSdS)Nz+invalid syntax for function call expression)r?r<)r��r5rlr8r9�ensurejs�z&Parser.parse_call_args.<locals>.ensurerVr�rrr'r{r�r[T)r,rur�r>rWrwr�r�rer�rHrr�r<)	r5r��kwargs�dyn_args�
dyn_kwargs�
require_commarEr8rer8rDr9�parse_call_argsbsB




�"zParser.parse_call_argscCs0|jj}|��\}}}}tj||||||jd�Sr�)r,r>rJrr�r<)r5r�rlr�rFrGrHr8r8r9r:�szParser.parse_callr�c		Cs�|jjjdks	|rg|st|j�|j�d�}|j}|jjjdkr7t|j�|d|j�d�j7}|jjjdks |jjjdkrG|��\}}}}ng}g}d}}tj|||||||j	d�}d}|jjjdks	|s	|S)Nr<r'r�rBr�r[F)
r,r>rWrwrurerJr�Filterr<)	r5r�r�rlr'r�rFrGrHr8r8r9r��s(

���zParser.parse_filterc
	Cs*t|j�}|jj�d�rt|j�d}nd}|j�d�j}|jjjdkr;t|j�|d|j�d�j7}|jjjdks$d}}g}|jjjdkrQ|��\}}}}n+|jjjdvrz|jj�d	d
d�sz|jj�d�rm|�	d
�|�
�}	|�|	�}	|	g}ng}tj
|||||||jd�}|r�tj||jd�}|S)Nr�TFr'r�rBr�>r'r&r)r�r#r%r(r�r�r�zname:isz'You cannot chain multiple tests with isr[)rwr,r>r�rurerWrJrXr?r�rr�Testr<r)
r5r�rl�negatedr'rGrHrFr��arg_noder8r8r9r>�s>


��
�

�zParser.parse_testcshg�g��j}|dur|j�|�d
��fdd�}z�|jr�|jj}|jdkr:|jr4|tj|j|jd��t	|j�n]|jdkrSt	|j�||j
dd��|j�d	�nD|jd
kr�|�t	|j�|durx|jjj|�rx�W|durw|j�
�SS|��}t|t�r���|�n��|�|j�d�ntd��|js|�W|dur�|j�
��S|dur�|j�
�ww)Nr*cs<�r�dj}��tj�dd�|d���dd�=dSdS)Nrr[)r<rHrr�r[�r��data_bufferr8r9�
flush_data�s

�z#Parser.subparse.<locals>.flush_datar�r[�variable_beginTr�rT�block_beginrUzinternal parsing error)r*N)rHr4r,r>rWrerr�r<rwr~rurXrhrpr�rP�extend�AssertionError)r5rO�add_datarQrlr`r8rOr9rv�sR




���

�
��zParser.subparsecCs"tj|��dd�}|�|j�|S)z0Parse the whole template into a `Template` node.rr[)r�Templaterv�set_environmentr%)r5rxr8r8r9r1szParser.parse)NNNr�)NN)F)..)TFNF)T)FTNF)_r��
__module__�__qualname__�__doc__�str�t�Optionalr:r�int�Typer?r3r0rMrNrRr�rYrr^ra�Unionr_rpryrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�r�r�r�r
r�r�rir�rjr�r�r�r��typing�overloadr�r}r�r/r�r�r�r�r�rrrrrrr�r~r+r7r,rrr?r@r9rArJr�r:r�r>rvrWr1r8r8r8r9r$.sx������
�����
����
�)���
����
���
�
"���

���
�.	���������������
�*			

$�����
�B
�
� 1�
��

�+��

�1r$)'r[rbr]r$r�
exceptionsrr�lexerrr�
TYPE_CHECKING�typing_extensions�ter%r�TypeVarr�r�r	r�r�r
�	frozensetrfr�Add�Sub�Mul�Div�FloorDiv�Modr#r7r\r`r/�__annotations__r$r8r8r8r9�<module>s2� �

Spamworldpro Mini