| Server IP : 93.86.61.54 / Your IP : 216.73.216.206 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/mako/__pycache__/ |
Upload File : |
o
�p�^� � @ s� d Z ddlZddlmZ ddlmZ ddlmZ G dd� de�ZG dd � d e�ZG d
d� de�Z G dd
� d
e�Z
G dd� de
�ZdS )zjutilities for analyzing expressions and blocks of Python
code, as well as generating Python from AST nodes� N)�compat)�
exceptions)�pyparserc @ � e Zd ZdZdd� ZdS )�
PythonCodez<represents information about a string containing Python codec K s` || _ t� | _t� | _t|tj�rtj|� � dfi |��}n|}tj
| fi |��}|�|� d S )N�exec)�code�set�declared_identifiers�undeclared_identifiers�
isinstancer �string_typesr �parse�lstrip�FindIdentifiers�visit��selfr �exception_kwargs�expr�f� r �*/usr/lib/python3/dist-packages/mako/ast.py�__init__ s zPythonCode.__init__N��__name__�
__module__�__qualname__�__doc__r r r r r r � r c @ r )�ArgumentListzBparses a fragment of code as a comma-separated list of expressionsc K s� g | _ g | _t� | _t� | _t|tj�r/t� d|�r$t� d|�s$|d7 }t
j|dfi |��}n|}t
j| t
fi |��}|�|� d S )Nz\Sz,\s*$�,r )�codeargs�argsr r
r r r r
�re�matchr r � FindTupler r r r r r r 7 s zArgumentList.__init__Nr r r r r r 3 r r c � e Zd ZdZ� 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):
c s� t �d|�� t j�}|stjd| fi |���|�d�r%|d |�d�� }|�dd�\}}|dv r6|d }n7|dkr?|d }n.|d
ksG|dkrNd| d }n|d
krYd| d }n|dkrb|d }ntjd| fi |���tt | �j
|fi |�� d S )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')r$ r% �strip�Sr �CompileException�group�start�superr( r )r r r �m�keywordr �� __class__r r r V s4 ��
��zPythonFragment.__init__�r r r r r �
__classcell__r r r= r r( I s r( c @ s0 e Zd ZdZddd�Zddd�Zedd � �Zd
S )
�FunctionDeclzfunction declarationTc K s� || _ tj|dfi |��}tj| fi |��}|�|� t| d�s+tjd| fi |���|s>| jr@tjd| j d fi |���d S d S )Nr �funcnamez'Code '%s' is not a function declarationz('**%s' keyword argument not allowed here���)
r r r � ParseFuncr �hasattrr r7 �kwargs�
kwargnames)r r �allow_kwargsr r r r r r r v s&