HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/sqlparse/__pycache__/utils.cpython-310.pyc
o

�h�
�@s�ddlZddlZddlmZddlmZe�dej�Ze�d�Z	dd�Z
dd	�Zd
d�Zddd
�Z
dd�Zeddd��Zeddd��ZdS)�N)�deque)�contextmanageraZ
(
 (?:                     # Start of non-capturing group
  (?:\r\n|\r|\n)      |  # Match any single newline, or
  [^\r\n'"]+          |  # Match any character series without quotes or
                         # newlines, or
  "(?:[^"\\]|\\.)*"   |  # Match double-quoted strings, or
  '(?:[^'\\]|\\.)*'      # Match single quoted strings
 )
)
z(\r\n|\r|\n)cCsRt|�}t�|�}dg}|D]}|sqt�|�r|�d�q|d|7<q|S)z�Split a string on all unquoted newlines.

    Unlike str.splitlines(), this will ignore CR/LF/CR+LF if the requisite
    character is inside of a string.����)�str�SPLIT_REGEX�split�
LINE_MATCH�match�append)�stmt�text�lines�outputlines�line�r�A/usr/local/CyberCP/lib/python3.10/site-packages/sqlparse/utils.py�split_unquoted_newlines$s

rcCs8|durdS|ddvr|d|dkr|dd�}|S)z4Helper that removes surrounding quotes from strings.Nr)�"�'�`r�r)�valrrr�
remove_quotes6s
rcs�fdd�}|S)zqFunction decorator to help with recursion

    :param cls: Classes to not recurse over
    :return: function
    cs���fdd���S)Ncs,|��D]}t|��s�|�q�|�dS�N)�get_sublists�
isinstance)�tlist�sgroup)�cls�f�	wrapped_frrr!Fs

�z(recurse.<locals>.wrap.<locals>.wrapped_fr)r �r)r r!r�wrapEszrecurse.<locals>.wrapr)rr#rr"r�recurse?s	r$cs��durdS|rt�|�rdS|r+t|t�r$t�fdd�|D��r#dSn�j|�r+dS|rHt|t�rAt�fdd�|D��r?dSdS�j|vrHdSdS)aHelper function to simplify comparisons Instance, Match and TokenType
    :param token:
    :param i: Class or Tuple/List of Classes
    :param m: Tuple of TokenType & Value. Can be list of Tuple for multiple
    :param t: TokenType or Tuple/List of TokenTypes
    :return:  bool
    NFTc3s�|]}�j|�VqdSr)r
)�.0�pattern��tokenrr�	<genexpr>_��zimt.<locals>.<genexpr>c3s�|]}�j|vVqdSr)�ttype)r%r+r'rrr)er*)r�list�anyr
r+)r(�i�m�trr'r�imtQs&
�


�r1cCstt�||�dd�dS)zCAdvance the iterator n-steps ahead. If n is none, consume entirely.r)�maxlenN)r�	itertools�islice)�iterator�nrrr�consumelsr7cc�(�|j|7_dV|j|8_dSr)�offset��filter_r6rrrr9q��r9rccr8r)�indentr:rrrr=xr<r=)NNN)r)r)r3�re�collectionsr�
contextlibr�compile�VERBOSErr	rrr$r1r7r9r=rrrr�<module>s"

�