Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/mako/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/mako/__pycache__/ast.cpython-38.pyc
U

O��g��@srdZddlZddlmZddlmZGdd�d�ZGdd�d�ZGd	d
�d
e�ZGdd�d�ZGd
d�de�Z	dS)zjutilities for analyzing expressions and blocks of Python
code, as well as generating Python from AST nodes�N)�
exceptions)�pyparserc@seZdZdZdd�ZdS)�
PythonCodez<represents information about a string containing Python codecKsV||_t�|_t�|_t|t�r6tj|��df|�}n|}tj	|f|�}|�
|�dS)N�exec)�code�set�declared_identifiers�undeclared_identifiers�
isinstance�strr�parse�lstripZFindIdentifiers�visit��selfr�exception_kwargs�expr�f�r�5/opt/cppython/lib/python3.8/site-packages/mako/ast.py�__init__s
zPythonCode.__init__N��__name__�
__module__�__qualname__�__doc__rrrrrrsrc@seZdZdZdd�ZdS)�ArgumentListzBparses a fragment of code as a comma-separated list of expressionscKszg|_g|_t�|_t�|_t|t�rXt�d|�rFt�d|�sF|d7}t	j
|df|�}n|}t	j|tf|�}|�
|�dS)Nz\Sz,\s*$�,r)Zcodeargs�argsrrr	r
r�re�matchrrZ	FindTuplerrrrrrr6s
zArgumentList.__init__Nrrrrrr2srcs eZdZdZ�fdd�Z�ZS)�PythonFragmentz�extends PythonCode to provide identifier lookups in partial control
    statements

    e.g.::

        for x in 5:
        elif y==9:
        except (MyException, e):

    cs�t�d|��tj�}|s*tjd|f|��|�d�rF|d|�d��}|�dd�\}}|dkrh|d}nb|dkrz|d	}nP|d
kr�d|d}n:|dkr�d
|d}n$|dkr�|d}ntjd|f|��t�j	|f|�dS)Nz^(\w+)(?:\s+(.*?))?:\s*(#|$)z0Fragment '%s' is not a partial control statement���)�for�if�while�pass�tryzpass
except:pass)�elif�elsezif False:pass
�exceptz	try:pass
�withz!Unsupported control keyword: '%s')
rr �strip�Sr�CompileException�group�start�superr)rrr�m�keywordr��	__class__rrrUs4��



��zPythonFragment.__init__�rrrrr�
__classcell__rrr6rr!Hsr!c@s0eZdZdZddd�Zddd�Zedd	��Zd
S)
�FunctionDeclzfunction declarationTcKsp||_tj|df|�}tj|f|�}|�|�t|d�sJtjd|f|��|sl|jrltjd|j	df|��dS)Nr�funcnamez'Code '%s' is not a function declarationz('**%s' keyword argument not allowed here���)
rrrZ	ParseFuncr�hasattrrr0�kwargs�
kwargnames)rrZallow_kwargsrrrrrrrus$

��
���zFunctionDecl.__init__Fc	Cs6g}|jddd�}|jddd�}|jddd�}|jddd�}|jr^|�d|�d��|D]f}|r~|�d||f�qb|r�|�d�}|dkr�|�|�q�|�d|t�|��	�f�qb|�|�qb|j
r�|�d|�d��|D]@}|s�|�s|�|�q�|�d�}|�d|t�|��	�f�q�|��|S)aEReturn the argument declarations of this FunctionDecl as a printable
        list.

        By default the return value is appropriate for writing in a ``def``;
        set `as_call` to true to build arguments to be passed to the function
        instead (assuming locals with the same names as the arguments exist).
        Nr<z**rz%s=%s�*)�argnamesr?�defaults�
kwdefaultsr>�append�poprZExpressionGenerator�value�varargs�reverse)	rZas_callZ	namedeclsrAr?rBrC�name�defaultrrr�get_argument_expressions�sB	
��

��z%FunctionDecl.get_argument_expressionscCst|j�t|j�S)N)�tuplerAr?)rrrr�allargnames�szFunctionDecl.allargnamesN)T)F)rrrrrrK�propertyrMrrrrr:qs


9r:cs eZdZdZ�fdd�Z�ZS)�FunctionArgsz.the argument portion of a function declarationcst�jd|f|�dS)Nzdef ANON(%s):pass)r3r)rrr>r6rrr�szFunctionArgs.__init__r8rrr6rrO�srO)
rr�makorrrrr!r:rOrrrr�<module>s")T

F1le Man4ger